Trying to pass the response data from parent to child component. I have used input decorator. But, it is not working. Previous values are only shown. So, How we can show the updated array response data. If anyone knows please help to find the solution.
app.component.ts:
public allData = ['Van1', 'Hills2', 'Root3'];
constructor(private dataService: DataService) {}
ngOnInit(): void {
this.dataService.getData().subscribe((data) => {
this.allData = data;
console.log(this.allData); // It is data.json data
});
}
Demo : https://stackblitz.com/edit/angular-ivy-67cnnt?file=src%2Fapp%2Fapp.component.ts