我有一個應用程序,其中一個ContainerView有超過6個動態childViews。我發現Ember沒有連接到各自的childViews的控制器,我的數據與這個childViews目前正在retreiving在childViews本身。我試過甚至使用containerView的控制器,但是childView的數據彼此獨立並且需要多個請求來獲取數據。有沒有更好的辦法可以做到這一點?下面是示例代碼,我做了RightNow如何從不同的AJAX請求containerView的childViews的數據?
var App=Ember.Application.create();
App.TestView=Ember.ContainerView.create({
init: function(){
var childViews=this.get('childViews');
childViews.pushObject(Ember.View.create({
data:this.getData(),
getData : function() {
//Ajax Call
}
}));
}
});
App.TestController=Ember.Controller.create({
content : []
});
我並不真正需要'燼,data'我的應用程序主要是分析一種.. – thecodejack