samedi 27 décembre 2014

Does iron:router have an equivalent to Ember's transitionToRoute?

I need the ability to programmatically route to different pages. As far as I can tell the only way to actually render a route is from within the Route declaration as such:



Router.route('/', function() {
this.render('index');
});


What I'm looking for is the ability to from some arbitrary part of the code to transition to another route. i.e. if(whatever) Route.transionToRoute('homepage');


I by snooping around found that I could use Router.dispatch, but I got some buggy behavior that I believe originated from that usage, in addition I got some strange debug warnings in the console. It appears to be an internal method as I can't find any documentation on it.


Can what I've described be done with iron router?


Thanks for any help :)





Aucun commentaire:

Enregistrer un commentaire