本文介绍了当{{#each ...}(未定义))使用{{action ...}}设置的event.context的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次尝试Ember.js,大致遵循Ember.js指南,但我遇到以下问题。

I'm trying out Ember.js for the first time by roughly following the Ember.js guide, but I'm running into the following problem.

相关代码:
(对于完整的rails应用程序,请参阅:)

Relevant code:https://gist.github.com/3257657 (for complete rails app, see: https://github.com/basveeling/ember-test)

上下文:
我正在运行最新的ember-rails构建与1.0预发布ember.js。我正在使用ember-data作为帖子模型。

Context:I'm running the latest ember-rails build with the 1.0 prerelease ember.js. I'm using ember-data for the post model.

几乎所有的功能都在这个应用程序中,除了由 {{action showPost context =posthref = true}} 有一个未定义的id(#/ posts / undefined )。
此外,传递给 showPost 操作的jQuery事件没有context属性(它有一个view属性)。

Almost everything works in this app, except that the hrefs created by {{action showPost context="post" href=true}} have an undefined id (#/posts/undefined).Furthermore, the jQuery event passed to the showPost action doesn't have a context property (it does have a view property).

我是以错误的方式进行的,或者我可能偶然发现预发行的错误?

Am I going at this the wrong way, or have I perhaps stumbled on a bug in the prerelease?

编辑:这可能是相关的

这篇关于当{{#each ...}(未定义))使用{{action ...}}设置的event.context的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 08:19