我正在尝试观察我的视图控制器的内容。视图的控制器通过 contentBinding 绑定(单向)到另一个控制器的内容。我试图在内容更改时执行“facContent”。不工作。可能是PEBCAK。任何帮助表示赞赏。
/*________VIEW OBSERVING CONTROLLER CONTENT___________*/
App.GeoView = Ember.View.extend({
facsContent: function() {
//do something
}.observes('controller.content'),
});
/*_________CONTROLLER WHO IS BEING OBSERVED BY GEOVIEW / HAS CONTENT BINDING TO ANOTHER CONTROLLER__*/
App.GeoController = Ember.ObjectController.extend({
content:[],
contentBinding:('controllers.geoFacs'),
});
/*___________CONTROLLER WHOSE CONTENT CHANGES_____________*/
App.GeoFacsController = Ember.ArrayController.extend({
content:[]
});