我试图理解setupController
andmodel
钩子,它们是否只会在动态段的情况下被调用?
这是我的路由器配置,我看到应用程序运行良好,但我没有看到这些钩子被执行:
// Router, this need to connect view and controller
App.Router.map(function(){
this.resource("login", {path : "/"});
this.resource("home" , {path : "home/:home_id"});
});
App.Router.IndexRoute = Ember.Route.extend({
setupController:function(controller,model){
console.log("in setupController hook for index route");
}
});
App.Router.LoginRoute = Ember.Route.extend({
setupController:function(controller,model){
console.log("in setupController hook for login route");
}
});
App.Router.HomeRoute = Ember.Route.extend({
setupController:function(controller,model){
console.log("in setupController hook for login route");
}
});