When I try to pass data from parent to child component. I\'m getting undefined message in the console. Data is in the form of array.
parent.component.html
You can't do the assignment in the constructor as the value has not yet been populated, it should be done in ngOnInit just like your check of the value.
ngOnInit
@Input() data; question = []; constructor() { } ngOnInit() { this.question = this.data; console.log(this.question); }