I got the following html
<app-grid [columns]="columns" [data]="data" ></app-grid>
I want the data and columns properties to be immutable. The Grid should only show it. But in cases of sort or filtering the data would change, at least the order.
But here is my problem. If I access the data array and modify one property of an containing object. Like this.
this.data[0].name = "test"
The original gets changed. But I thought [data] is only one way data bound.
Could somebody point me in the right direction, to why this is happening and how I can omit it. I come from React where this would be pretty straight forward.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…