I have four components and I need to pass data from a parent to a child.
The structure in the map.html
template looks something likes this:
<map-builder [width]="width">
<layer [name]="'markerLayer'">
<marker [lat]="8.5" [lng]="55.5"></marker>
<marker [lat]="54" [lng]="8.5"></marker>
</layer>
<layer [name]="'heatmapLayer'">
<heatmap></heatmap>
</layer>
</map-builder>
In the LayerComponent
I have the variables layer
and source
. In ngOnInit()
I set both values. Now I need to access both values in the nested component (Marker
and Heatmap
). I tried to inject the LayerComponent
in the constructor()
, but I can't access its variables.
Thanks for the help!