I am creating a small app using Angular2+Ionic2
. In this app I want initialise google-map
into view segment
when user
Finally how I resolved this is by, by providing a (change)="onSegmentChanged($event)"
on ion-segment element
.
Which will trigger whenever ion-segment
will switch
. And I am able to access the dom element with id googleMapAllFobs
when its getting switched to value="map"
.
Provided a checking in onSegmentChanged
function, before call load google map
function, to ensure the current view contains div to load google map.
Looks very easy for this current requirement.