0

I am trying to call a function when user touches(clicks) on infoWindow. User scenario: User clicks on a google maps marker, an info window opens. User clicks on an item in infoWindow content. This click calls a function and another page opens. I am doing this in ionic 2 and typescript.

Here is the info window content :

text2 = text2 + '<div id="wrapper">' + '<div id="sidebar" >' + '<h5 onclick()=" '+ this.goToDealPage(businessDetails.deals[a])+ ' ">'+ businessDetails.deals[a].deal.title +'</h5></div>'+ '<div id="content"><h4 class="realprice"><del>'+ businessDetails.deals[a].deal.real_price + '</del></h4>' +'<h4 class="dealprice">'+ businessDetails.deals[a].deal.deal_price +'</h4></div>'+ '<br></div>';

What is happening now: When I click on the marker, this.goToDealPage(..) is directly called and the page opens immediately before clicking on infoWindow. I want it to be called when user click on infoWindow link not the marker itself.

Daniel B
  • 8,770
  • 5
  • 43
  • 76
burc
  • 41
  • 5
  • Please include all code in `{ code brackets }` instead of an image. – Daniel B Feb 05 '17 at 10:07
  • Here it is. When I try to put this in the question window, this code gets lost. Thats why I had to send it as an image. { text2 = text2 + '
    ' + ''+ '

    '+ businessDetails.deals[a].deal.real_price + '

    ' +'

    '+ businessDetails.deals[a].deal.deal_price +'

    '+ '
    '; }
    – burc Feb 05 '17 at 10:18
  • Use the buttons in the edit form. I'll fix it for you, but it's a good idea to read the help docs on how to post! – Daniel B Feb 05 '17 at 10:36
  • You could make you life a lot easier by using ES6 template strings –  Feb 05 '17 at 18:52
  • How you are attaching the click event on marker. There only the error is. – Programmer Feb 06 '17 at 09:35

0 Answers0