My goal is to pass the locations array from the results.component (grand-parent) to destination-selector.component (parent) through the bid-filter.component (child).
results.ts (grand-parent)
this.subscriptions.add(
this.customerService.getAllDestinations().subscribe(loc => {
this.locations = loc.payload;
console.log("from results",this.locations);
})
);
The log here is defined and shows the locations array
results.html (grand-parent)
<app-bid-filter [locations]="locations" [selectedValues]="selectedValues"
(search)="toggleFilters();search($event)"></app-bid-filter>
bid-filter.ts (parent)
@Input() locations;
ngOnInit() {
this.isHome = this.router.url === '/home';
console.log(this.locations);
}
the log here is undefined
bid-filter.html(parent)
app-destination-selector (selectedDestination)="selectedLocation($event)" [destinations]="locations"
[defaultDestinationId]="selectedValues?.destination"></app-destination-selector>
destination-selector.ts (child)
@Input() destinations;
ngOnInit() {
console.log(this.destinations);
}
shows undefined as well
Am I missing something pretty obvious over here? I checked a couple of solutions which were not applicable to my issue Angular 2 Component @Input not working
any help is appreciated.