@philipdring wrote:
Hi,
I am using Wayfinding (https://github.com/ucdavis/wayfinding) in my mobile app and would like to trigger an Ionic modal when the user clicks on one of the rooms. At the moment, there is a simple alert:
$('#Rooms a', el).click(function (event) { event.preventDefault(); alert('You have clicked on room ' + $(this).prop('id')); });However I would like to use this.presentModal() which references a simple function outside the jQuery code:
presentModal() { let modal = this.modalCtrl.create(ModalPage); modal.present(); }$('#Rooms a', el).click(function (event) { event.preventDefault(); this.presentModal(); });In this case, “this” isn’t the right way to access the presentModal() function. Does anyone know what is?
Thanks!
Posts: 1
Participants: 1