Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49526

Access native Ionic function within jQuery

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 49526

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>