I have in my parent component this:
obj: any = { row1: [], row2: [], total: [], sumTotal: 0 };
I pass obj to child component :
<tr table-tr-tr *ngFor="let key1 of channels[name];let i=index" [key1]="key1" [data]="array" [field]="key1"
[width]="width" [plantype]="plantype" [custom]="custom" [i]="i" [row]="row" [obj]="obj"></tr>
</table>
In child component i have this:
ngOnInit() {
for (let index = 0; index < this.data.length; index++) {
this.array.push({ code: index, value: 0 });
}
this.obj['row2'][this.field] = this.array;
}
Inside this child component i have another child component where i change values of array but its not changing on my parent object. Any suggestion how can i achive this?
EventEmitterto emit events from child component to parent component? Data flow between parent and child components is not two-way in Angular.