I have following parent html
<p>Parent</p>
<app-child [mainData]="mainData"></app-child>
parent.ts
mainData = [];
ngOnInit() {
this.myService((res)=>{
this.mainData = res;
})
}
Child html
<p>My JSON {{mainData | json}}</p> //Here getting result from parent
child.ts
@Input() mainData = [];
myDataCopy = [];
ngOnInit() {
this.myDataCopy = this.mainData;
console.log('My copy Data', this.myDataCopy); // Doesn't get result on here
}
If I need to process the @Input data how it possible?