gpt4 book ai didi

ember.js - this.get (‘model’ ).addObjects(records);抛出异常 “Uncaught TypeError: internalModel.getRecord is not a function”

转载 作者:行者123 更新时间:2023-12-01 06:10:28 27 4
gpt4 key购买 nike

需要帮助的 friend ,更新到 Ember 2.X 后,我的无限滚动停止工作。在到达页面末尾时,我查询 store 以获取新记录:

 load_more: function(){
var self = this;
this.get("store").query("actor",{pg: 1}}).then(function(records) {

self.get('model').addObjects(records); // this throw excepton

}
}

这工作完美,但现在 self.get('model').addObjects(records);抛出异常 "Uncaught TypeError: internalModel.getRecord is not a function" in record-array.js at line 86 "return internalModel && internalModel.getRecord()" .

我尝试使用 self.get('model').pushObjects(records);但它也给出了同样的错误,请帮忙

最佳答案

我们有同样的问题..尝试做

self.get('model').toArray().pushObjects(records)

关于ember.js - this.get (‘model’ ).addObjects(records);抛出异常 “Uncaught TypeError: internalModel.getRecord is not a function”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33317237/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com