0
我有我的控制器,记录是一个计算属性。在orderBy
或page
更改我的应用程序执行新呼叫。 该控制器完美的作品:Ember - 承诺数组
App.IndexController = Ember.ArrayController.extend({
...
records: function() {
return this.store.find("record", {
page: this.get("page"),
page_size: this.get("pageSize"),
order_by: this.get("orderBy")
})
}.property("key", "orderBy", "page"),
})
但是,如果我想请求时显示一个沙漏:
App.IndexController = Ember.ArrayController.extend({
...
records: function() {
this.showHourglass();
return this.store.find("record", {
page: this.get("page"),
page_size: this.get("pageSize"),
order_by: this.get("orderBy")
}).then(function(records) {
this.hideHourglass();
return records;
})
}.property("key", "orderBy", "page"),
})
我得到这个错误: Uncaught Error: Assertion Failed: The value that #each loops over must be an Array. You passed {_id: 59, _label: undefined, _state: undefined, _result: undefined, _subscribers: }
我怎样才能解决这个问题? 感谢
编辑: 在我的模板有一个循环,在物业:
{{#each records}}
...
{{/each}
现在感谢它的工作! – Griffosx 2014-10-29 13:06:41