What is the execution order of Meteor Iron Router hooks? -


i have router code:

router.route('/box', {     name: 'box',     action: function(){         this.layout('appwrapperloggedintpl');         this.render('boxcanvastpl');     },     onafteraction: function(){         console.log("onafteraction executed!");         renderboxpage();     } }); 

and onrendered function:

template.boxcanvastpl.onrendered( function() {     console.log('onrendered executed!'); }); 

when run this, "onafteraction executed!" appears before "onrendered executed!" message. have thought this.render('boxcanvastpl'); part of router code have executed beforehand, not expected?

the execution order correct this.render('boxcanvastpl'); take time template inserted dom. may want move renderboxpage(); onrendered function.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -