Dynamic computed properties in Ember.JS deprecated?

后端 未结 2 1753
失恋的感觉
失恋的感觉 2021-02-08 19:37

I am trying to make an ember application. I have a computed property and the controller looks like this:

// The Controller

Todos.Controller = Ember.Controller.c         


        
2条回答
  •  北海茫月
    2021-02-08 19:59

    It also seems to work ok if you do a reopen:

    Todos.todosController = Ember.Controller.create({
        // ** SNIP ** //
    });
    
    Todos.todosController.reopen({
        countCompleted: function() {
            return this.get('todos').filterProperty('completed', true).length
        }.property(),
    });
    

提交回复
热议问题