lundi 6 juin 2016

How to determine the Ember route name from a URL?

I need determine the route name from a URL string.

This is normally work that the Router does internally, but because of {insert long story here} I need to do it manually. I am given a piece of data from the API that looks like 'gallery/123' and I need to know the route name is 'gallery.post'. So that I can do route.replaceWith(determinedRouteName);

  • Need to turn 'gallery/123' into 'gallery.post'
  • Need to turn 'stuff/99/comments' into 'stuff.post.comments'
  • Etc



Aucun commentaire:

Enregistrer un commentaire