For the purpose of this question, I have simplified some code.
this.getDataRuleList.splice(this.count, 1, dataRuleData);
console.log(this.getDataRuleList);
this.count += 1;
The getDataRuleList function is responsible for returning an array of objects from a service. It is seamlessly bound to a PrimeNg TurboTable.
// get method to retrieve service collection
get getDataRuleList(): IDataRule[] {
return this._dataRuleListService.dataRuleList;
}
Whenever I attempt to edit a row and update an object within my bound array (getDataRuleList) by replacing it entirely with a new object, all elements in the array end up being identical to the newly inserted value. Despite providing different values each time (dataRuleData), the issue persists. I suspect that it has something to do with references, but how can I prevent this from occurring?