我使用流星與AutoForm &鐵路路由器。使用鐵路路由器到Meteor autoform提交的新數據的路由?
我有一個autoform插入數據,我想重定向到成功插入後添加的數據頁面。我應該怎麼做?
這裏是爲了:
{{#autoForm collection="Products" id="add" type="insert"}}
<h4 class="ui dividing header">Products Information</h4>
{{> afQuickField name='name'}}
{{> afQuickField name='info'}}
<button type="submit" class="ui button">Insert</button>
{{/autoForm}}
鐵路由器:
Router.route('/products/:_id', {
name: 'page',
data: function() { return Products.findOne(this.params._id);}
});
回調/鉤
AutoForm.hooks({
add: {
onSuccess: function(doc) {
Router.go('page', ???);
}
}
});
的http://計算器.COM /問題/ 26 851878/meteor-ironrouter-passing-routers-goes- –