In my router, I defined one route:
this.route('static', {path: '/static/:title'});
And in my IndexView’s didInsertElement, when I clicked a button, the following code will be executed:
this.get('controller').transitionToRoute('static', {title: 'content'});
And in my StaticRoute:
App.StaticRoute = Em.Route.extend({
model: function(param) {
console.log(_Const.url.getStaticPic + '?callback=?&title=' + param.title);
return $.getJSON(_Const.url.getStaticPic + '?callback=?&title=' + param.title).then(function(data) {
return data;
});
},
setupController: (controller, model) {
console.log('in static setupController');
}
});
When transitionToRoute in the IndexView is called, no info was printed in the console, meaning that the model hook or the setupController hook didn’t get executed in the StaticRoute. Why does this happen? Is there anything I’ve done wrong? Thanks for your help