I am trying to pass data that is dynamic to a child component. But I always get the data as undefined in the child component. Below is what I am doing.
ParentComp
Why not using the Observable with the async pipe. If you want to console-log that value use a setter. The async pipe will also take care about unsubscribing.
results: Observable;
ngOnInit() {
this.results = this.http.get('url');
}
In the HTML
And in your child component
@Input('dataNeeded')
set dataNeeded(val: any[]) {
console.log(val);
}