相关疑难解决方法(0)

Ember.JS中的动态计算属性已弃用?

我正在尝试制作一个余烬应用程序.我有一个计算属性,控制器看起来像这样:

// 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

9
推荐指数
1
解决办法
4805
查看次数

标签 统计

ember.js ×1