I have a parent component which is getting data from a server through a service. I need some of this data to be passed to the Child component.
I\'ve been trying to p
@Component({
selector: 'test-child',
template: `
`
})
export class ChildComponent implements OnChanges {
@Input() childData: any;
ngOnChanges() {
console.log(childData); // logs undefined
}
}
This is supposed to be like this, no? I hope this might be the problem.
ngOnChanges() {
console.log(this.childData); // reference with this
}