我正在尝试制作一个余烬应用程序.我有一个计算属性,控制器看起来像这样:
// The Controller
Todos.Controller = Ember.Controller.create({
// ** SNIP ** //
countCompleted: function()
{
return this.get('todos').filterProperty('completed', true).length
}.property(),
});
// The View
{{Todos.Controller.countCompleted.property}} Items Left
Run Code Online (Sandbox Code Playgroud)
现在我正在使用的教程是使用旧版本的Ember.JS.我修复了每个错误,但是这个:
Uncaught Error: assertion failed: Ember.Object.create no longer supports defining computed properties.
有什么替代方法可以做到这一点?
ember.js ×1