i had this problem too last time and i already solve this with googling and testing whole day on this issue…surprisingly seems like very less people have this requirement in their ionic app with google map integration…this is how i solve my problem. what i done is a map with marker and infowindow and when i press on the infowindow i would like to push to a detail page with id as navParam
1.) Import NgZone from ‘@angular/core’
2.) Add this line inside your constructor (window as any).angularComponent = { GoDetail: this.GoDetail, zone: zone }; (GoDetail is the name of function you would like to call when you press infoWindow)
3.) Create the GoDetail function with this code GoDetail = (id: any) => { this.zone.run(() => { //Navigate To New Page this.nav.push(GolfClubDetails, { 'SelectedGolfClubID': id }); }); } (you must wrap your code inside this.zone.run() else your code wouldn;t able to run, GoDetail is your function name and (id:any) is the parameter you want to pass from the infoWindow)
4.) When Creating content of your InfoWindow use onclick=\"window.angularComponent.GoDetail('" + golf.ID + "');\" (as you can see you need to use onclick instead of (click))
i don‘t think you can pass object in plain javascript onclick function…a nice hack would be add an id for your events item and pass event.id. after that you can use the id to get your object if your object is store in a list