有时我需要重新渲染所有视图和调用App.router.connectOutlet
,但我没有上下文可以传递给这个方法。
第一个参数 router 我设置为App.router
,但是第二个有问题。
有没有办法得到它?
编辑:
Ember.Route.extend( {
home : Ember.Route.extend( {
route : '/:cat_id',
connectOutlets : function(router, context) {
// ...
},
doFooterService : function( router, event ) {
App.router.transitionTo( 'home', {
cat_id : event.view.content.id
});
},
},
// ...
}
有时我必须手动调用 connectOutlets 函数来重新渲染页面。我不想去其他地方,而只是用其他参数重新渲染这个视图。但我不知道应该作为上下文参数传递什么。