I have three Ember.js controllers that look like this:
App.CategoryController = Ember.ArrayController.extend({
hideCompletedContent: false,
needs: ['browse', 'activity'],
actions: {
hideCompletedClick: function () {
this.toggleProperty('hideCompletedContent');
}
},
});
App.ActivityController = Ember.ArrayController.extend({
needs: ['category', 'browse'],
itemController: 'activityItem'
});
App.ActivityItemController = Ember.ObjectController.extend({
needs: ['browse', 'category'],
notifyCompletedStatus: function () {
console.log(this.get('controllers.category.hideCompletedContent'));
}.observes('controllers.category.hideCompletedContent'),
});
ActivityItemController is set as the itemController for ActivityController, and I want the ActivityItemController to observe changes on the hideCompletedContent property on the CategoryController.
For some reason, the notifyCompletedStatus function in the ActivityItemController is not fired when controllers.category.hideCompletedContent changes.
Does anyone have any idea as to why the the property isn't being observed?
In case this helps, the hideCompletedClick action in the CategoryController is being called when a checkbox in the template is clicked.
Thanks for all the help!
Aucun commentaire:
Enregistrer un commentaire