self.resultList.forEach(function(item, index, enumerable){
console.log(self.resultList);
item.id=11;
item.get('id');
});
這樣的項目: 如何使用Ember.js Array forEach更改值?
如果item.id = 11;
異常這樣的:
Assertion failed: You must use Ember.set() to access this property (of [object Object])
所以item.get( 'ID')或item.set( 'ID',11 )
這樣
異常Uncaught TypeError: Object # has no method 'get'
這個項目不是Ember的對象?所以這個項目是什麼?
有人能告訴我如何改變「itme.id的價值..
萬分感謝
裏面是什麼self.resultList?我認爲數組包含普通的JS對象和Ember對象。 – mavilein