i've got some troubles while passing data(Array) between components by @Input, there is some code. parent.component.ts:
public ngOnInit() {
this.applications = new Array<ApplicationEntryInterface>();
(...)
let shortTermData = new ShortTermApplicationAdapter(application);
this.applications.push(shortTermData);
console.log(this.applications);
}
this console.log shows me normal array
parent.component.html
<student-application-overview [applicationsEntry]="applications"></student-application-overview>
Child component:
@Input('applicationsEntry') public applicationsEntry: Array<ApplicationEntryInterface>;
ngOnChanges() {
console.log(this.applicationsEntry);
console.log(this.applicationsEntry.length); <--- shows 0
}
which shows
It's impossible to iterate it in for, foreach, etc, only *ngFor works, this.applicationsEntry.length is equal to 0, how can I handle with it ?
Also I used @Input (..) set (..) { (..) } and it gave same result