meteor iron-router onStop get the next url -
when user routes away controller, want user been redirected, before redirected
the "onstop" hook lets me catch right place can not next url
this router function
router.route('page', { name:"page", onstop: function(){ //runs once when controller stopped, before user routes away. //what next path???????? } });
have tried create onbeforeaction? like:
router.route('page', { name:"page", onbeforeaction: function(){ var nextroute = router.current().route.getname(); } });
router.current().route.getname(); //will next route within onbeforeaction
Comments
Post a Comment