У меня есть список массивов с сервера в gridItems, для которого я создаю копию и использую оператор распространения
let gridItems = this.get('sectionInformation.gridItems');
this.get('sectionInformation.someRows').pushObject(gridItems);
var updatedContainers = [...gridItems];
set(this.get('sectionInformation'), 'someRows', updatedContainers);
self.get('sectionInformation.someRows').forEach(function(container) {
self._updateFieldsForSomeRows(container.fields);
});
_updateFieldsForSomeRows: function(fields, seqNum) {
// Inside this, I do
fields.forEach(function(field){
set(field, 'someAttr', 'someVal');
});
//After above code is run, I expected that this should affect the fields inside sectionInformation.someRows. However, it instead updates in "gridItems". Not sure why that is the case
}
Мой вопрос по какой-то причине затрагивает только исходную ссылку, а не sectionInformation.someRows