Exploring the integration of Ember.js with Phonegap, I have implemented the Confirm API. However, I am encountering an issue where executing this.transitionTo('index')
from the event-driven function onConfirm
is proving to be a challenge.
Any thoughts or suggestions on how to resolve this dilemma?
App.MainRoute = Ember.Route.extend({
actions:{
abort: function(){
navigator.notification.confirm(
'Are you sure?',
onConfirm,
'Abort',
['NO','YES']
);
function onConfirm(buttonIndex) {
if (buttonIndex == 2){
this.transitionTo('index');
}
}
//this.transitionTo('index');
}
}
})