jeudi 4 juin 2015

Transition to Ember route from a global function

My new ember-cordova app needs to listen to document events.

Specifically, each time the app becomes active on the device, the "resume" event will trigger on the document. The app needs to go back to the Log In page upon the "resume" event.

The initial idea was to activate a route by simply changing the window.location.href as follows:

document.addEventListener("resume", function() {
    window.location.href = "/#/login";
});

This does not trigger the route transition on my device (iOS). There must be a way to transition the route using the Ember API from an outside (global) function. Any one know how?




Aucun commentaire:

Enregistrer un commentaire