【发布时间】:2013-03-18 07:50:21
【问题描述】:
Here's a fiddle for this question(在第 5 行添加/删除单斜杠并重新运行)
基本上,两种绑定(专有名词?)我的应用程序模板的方式。我希望这两种方法都能奏效,但一种有效,另一种无效。
作品
this.register( 'view:application', Ember.View.extend());
this.register( 'template:application', Ember.Handlebars.compile( 'Hello, world!' ));
坏了
this.register( 'view:application', Ember.View.extend({
'template': Ember.Handlebars.compile( 'Hello, world!' )
}));
这似乎适用于所有资源/路由,而不仅仅是应用程序级别。
那么,为什么第二种方法不起作用?
编辑:这是一个another fiddle,它显示了使用上述方法 2(已损坏)成功完成的 Handlebars 视图助手。看来这只是路线视图的问题。
编辑 2:感谢 c4p 这是 Github 上的一个问题
【问题讨论】:
标签: javascript model-view-controller ember.js javascript-framework