任何人都可以向我解释为什么在调用ajax调用的成功方法之前,RecordArray状态为isLoaded
的设置为true。Ember-data RecordArray isLoaded状态
从余烬数据源代码
findAll: function(store, type, since) {
var root = this.rootForType(type);
this.ajax(this.buildURL(root), "GET", {
data: this.sinceQuery(since),
success: function(json) {
debugger;
Ember.run(this, function(){
this.didFindAll(store, type, json);
});
}
});
},
定义视图中的
handler: function() {
var content, controller = this.get('controller');
if(controller.get('content.isLoaded')) {
}
}.observes('controller.content.isLoaded')