I have a list of people and I would like to show how many posts are edited using Ember.js . Inside the PeopleController, I am trying to calculate the isEditing attribute from PersonController with the following code:
Schedule.PeopleController = Ember.ArrayController.extend({ editCounter: function () { return this.filterProperty('isEditing', true).get('length'); }.property('@each.isEditing') }); Schedule.PersonController = Ember.ObjectController.extend({ isEditing: false });
Unfortunately, I get 0 as a result of the editCounter function. This attribute ( isEditing ) should tell me how many people are being edited. The editCounter function is called inside the html archive, which I called index.html:
... {{outlet}} <div id="count_edits"> <span id="total_edits"> <strong>Editing: </strong> {{editCounter}} </span> </div> ...
So here is my question: how can I get isEditing correctly inside PeopleController ?
source share