lundi 30 novembre 2015

Ember: change route event from outside the app

Here is the context. I'm developing an Ember app, that will be embed in a Drupal page. Only problem: the menu of the app must be in the drupal page.

So I'm trying to find a way to update the url of the page (from outside the app) and to get the event of changing url inside Ember so I can then apply the route as usual.

I tried:

  • history.pushstate(). But it doesn't trigger "popstate" so I can't really get any callback.
  • use "hash" url type in ember config, and then get the hashchange event from inside Ember. It works but I'd like to use the "history" url type

I have to try:

  • in Ember app, get the click event on the outside menu, and apply my routes. (But it doesn't seem like a really clean solution, does it ?)

Any ideas I can get to do that ?

Thanks for your help !




Aucun commentaire:

Enregistrer un commentaire