我为选择的插件做了一个小混音,它在this fiddle中工作得很好。
当我在我的ember-rails应用程序中使用它时,选中的框出现了,但没有选项。我认为这与我使用ArrayController.extend和Object.create (在小提琴中)有关,但我不知道为什么。当我在rails中将extend更改为create时,它尝试创建控制器两次,并给出一个错误。
Ember变化如此之快,我是不是错过了从小提琴版本到ember-rails版本的一些东西?
(在https://github.com/camdub/watchd的assets下的ember-rails源代码)
发布于 2012-08-07 15:34:30
查看您的代码,您似乎正在使用路由。好的。您了解了在使用路由时,框架会为您实例化控制器,并且每个xxxView都有其xxxController实例,可通过controller属性进行访问。
在repos.handlebars中,尝试直接使用“控制器”。
<div class="container top-section">
{{view Watchd.ChosenSelect
contentBinding="controller.content"
valueBinding="controller.selected"
}}
</div>https://stackoverflow.com/questions/11838998
复制相似问题