Meteor passing variable from template to iron router -


i'm wondering if possible access variable / method of template in iron:router.

my problem : want reset lot of stuff launched template (timer / subscription / whatever) on page unload (from change page menu)

but window.onbeforeunload triggered when changing url. iron:router not reffreshing page , way found unload event passing iron:router's unload event. there, can't access template variable or method. way found @ moment passing reset var session... , find awful !

router.route('/printlist', { name: 'printjoblistlist', unload: function () {    var reset = session.get("sessiontestironrouter"); } 

have got advice, tips , bests ways ? :)

ok, solved this, not clean though.

i declared globalhelper in template client size :

template.registerhelper('functiontocall', function () {     // code here }); 

and in unload iron's route :

router.route('/template', {     name: 'mytemplate',     unload: function (e, obj) {         blaze._globalhelpers.functiontocall();     } }); 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -