【发布时间】:2014-01-16 09:29:24
【问题描述】:
是否有等待模板被渲染然后执行某些功能?
我试过了,还是不行。
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"))
}
});
});
原来子元素还不存在,因为在触发 after 函数时,'home' 模板尚未呈现。
非常感谢任何建议或解决方法。
【问题讨论】:
标签: javascript meteor handlebars.js iron-router