4
重用的资源,我有以下路由设置:灰烬路由:在多个父路径
this.resource('blog',function(){
this.resource('selectimage',{path:"selectimage/:returncontext"},function(){});
});
this.resource('post',{path:":post_id"},function(){
this.resource('selectimage',{path:"selectimage/:returncontext"},function(){});
});
我本来期望是,导航到blog.selectimage当post.selectimage,即同一个路由器,控制器和视图将被使用。 不幸的是,似乎最后一个条目赢了。
是否有可能实现这一点,而不离开父上下文(后/博客),当导航到selectimage (很明显,我可以继承base-selectimages类,但我希望有一些通用的烬)
尼斯。我不知道你可以在Route中指定控制器和模板。 – AyKarsi
..刚刚检查了文档@ http://emberjs.com/api/classes/Ember.Route.html:没有提及controllerName和templateName。看看源代码中的渲染方法,我发现你也可以指定viewName。 – AyKarsi
幸福,帮助你:) Ember Docs越来越好。相信它会更快 – selvagsz