0
で
Routes.jsをリダイレクトしません:Router.goはTemplate.events
Router.configure({
layoutTemplate: "defaultLayout",
before: function() {
if(!Meteor.user()) {
this.layout("loginLayout");
this.render('login');
}else{
this.layout("defaultLayout");
this.next();
}
}
});
Router.route('/',function(){
this.render('login');
this.layout('loginLayout');
});
Router.route('/botlist',{
template: "projects",
name: "projects",
data: function(){
return Projects.find({});
},
waitOn: function(){
return Meteor.subscribe('projects',Session.get("username"));
}
});
私はそのjsのように見えるのログインページがあります。
....
'click #btn-login'(e, t) {
var username = $('#email').val(),password = $('#password').val();
Meteor.call('loginWithad',username,password,function(err,response){
if(response.err){
.. }
else{
Meteor.call('finishLogin',username,password,function(err,res){
if(err){
...
}
else{
Session.set("username",res.givenName);
Router.go("/botlist"); //--> this router.go doesn't route to /botlist template
}
})
....
私のルータの定義上の任意の問題が?私は、複数のソリューションのどれも働いていない試してみました:
this.redirect()
Router.push
this.stop()
その後、Router.go()