我正在尝试将一些内容添加到名为 content 的数组中。测试值添加正确。GET 调用中的内容未加载。为什么这个?
App.CustomerController = Ember.ArrayController.extend({
content: [],
init: function() {
this._super();
content = this.get("content");
content.push(App.Customer.create({ name: 'Test' }));
$.get("/Customer/GetCustomers", {}, function (result) {
for (var I = 0; I < result.customers.length; ++I) {
content.push(App.Customer.create({ name: result[I] }));
}
});
}
});
App.Customer = Ember.Object.extend({
name: null
});