Is there anyway to wait for template to be rendered and then execute certain function?
I have tried after and it doesn't work.
Router.map(function () {
this.route('post', {
path: '/posts/:ll',
action: function () {
this.render('home');
},
after: function () {
var n = this.params.ll
UI.insert(UI.render(Template[n]), document.getElementById("child"))
}
});
});
Turns out the child element doesn't exist yet because the 'home' template isn't yet rendered when the after function is fired.
Any suggestion or work around is highly appreciated.
Can you do this:
action: function () {
this.render('home');
Template.home.rendered = function() {
// ...
Template.home.rendered = null;
};
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With