【发布时间】:2014-05-30 09:39:43
【问题描述】:
如何将 Iron Router 参数传递给 Template.myTemplate.rendered 回调?以下路由和回调函数为console.log 提供undefined。
网址
http://localhost:3000/story/1234
Router.js
Router.map( function() {
this.route('story', {
path: '/story/:_id',
template: 'story'
})
})
story.js
Template.story.rendered = function () {
console.log('params: ', this.params) // undefined
console.log('_id: ', this._id) // undefined
}
【问题讨论】:
标签: javascript node.js meteor