问题
I've got a route set up like this:
App.UserRoute = Ember.Route.extend({
renderTemplate: function() {
this.render('settings/user', {into: 'application', controller: 'User'});
this.render('settings/user_left', {outlet: 'left_menu'});
},
setupController: function(controller, user){
this.controllerFor('users').set('content', App.User.find());
}
}
Controller is:
App.UsersController = Ember.ArrayController.extend();
App.UserController = Ember.ObjectController.extend({
needs: 'users',
contentBinding: 'controllers.users.firstObject',
});
If I navigate to /user
it's ok. If I then navigate to somewhere else and press BACK (or just open the route), content of the template is never filled out, even though App.User.find() returns data properly and controllerFor also finds a controller. I think I'm doing something wrong with controllers but can't find what... If the page is refreshed it works fine of course.
Thanks
来源:https://stackoverflow.com/questions/15682550/reentering-a-route-doesnt-load-content