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
if you are sure that your service gets data successfully so this will work :
in the html of your parent component add the quotes :
in your child component , you will check changes of your Inputusing the OnCh:
ngOnChanges(changes: SimpleChanges) {
for (let propName in changes) {
// when your @Input value is changed
if(propName === "dataNeeded"){
console.log(dataNeeded);
}
}
}
Hope this would help :)