【发布时间】:2014-05-07 19:45:10
【问题描述】:
我是 Iron-router 的新手,这是问题所在(代码如下)
使用陨石和流星 0.8.1
App.Router.map(function() {
this.resource('post', { path: '/post/:post_id' }, function() {
this.route('edit');
this.resource('comments', function() {
this.route('new');
});
});
});
这是在 emberjs 路由器中完美运行的情况,我如何使用 Iron-router 解决流星中这种类型的嵌套路由级别?
认为可以通过会话解决??
在路由器中
this.route("v", {onBeforeAction: function() {Session.set('uniqueId', this.params._id);}, path: "/v/:_id"});
在 Template.v.events 中
"click #v": function(event, target) {
event.preventDefault();
Accounts.verifyEmail(Session.get('uniqueId'), function(error) {
if(error) throwError(error.reason); else Meteor.Router.to("/profile");
});
【问题讨论】:
标签: javascript meteor meteorite iron-router