I basically have a App which renders a small map. On this page is also a \"toggle\" button which hides the small map with a *ngIf in the parent component and displays the ma
Here is a solution,
Component template
Component class implements OnInit and has the next property
OnInit
@ViewChild('mapElementRef') mapElementRef: ElementRef;
finally initialize the map on ngOnInit method, you can use
ngOnInit
this.map.setTarget(this.mapElementRef.nativeElement);
Hope it helps.