ken*_*ken 6 ember.js ember-data
任何人都可以向我解释为什么isLoaded在调用ajax调用的成功方法之前RecordArray状态设置为true.
来自ember-data源代码
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);
});
}
});
},
Run Code Online (Sandbox Code Playgroud)
在视图中定义
handler: function() {
var content, controller = this.get('controller');
if(controller.get('content.isLoaded')) {
}
}.observes('controller.content.isLoaded')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2103 次 |
| 最近记录: |