vendredi 30 octobre 2015

How to transition to route in Ember from global context?

I am integrating a chrome extension with an ember app. I have some chrome extension code in my app.js file:

window.sendToExtension = (message, callback) => {
  chrome.runtime.sendMessage(extensionId, message, (response) => {
    console.log('got response from extension!!', response)
    if (response.path) {
      //Here I need to tell the ember app the transition to the given path
    }
  })
}

this refers to window so I can't just call this.transitionTo. How can I transition to the route name the extension has told me to?




Aucun commentaire:

Enregistrer un commentaire