Whenever I attempt to transfer data from a parent component to a child component, I encounter an undefined message in the console. The data is presented as an array.
Parent Component HTML:
<div class="section welcome-section fp-section fp-table" *ngFor="let section of sections">
<div class="fp-tableCell">
<app-question-card [data]="section"></app-question-card>
</div>
</div>
Child Component TypeScript:
@Input() data;
question = [];
constructor() {
this.question = this.data;
}
ngOnInit() {
console.log(this.question); //returns undefined
}