0
我想创建几个页面,将使用相同的菜单,以便我可以轻松地保存菜单的状态,并避免代码重复。我的问题是菜单模板不会在页面的菜单出口中呈现。模板不渲染到命名插座
下面是代码:
App.Router.map(function() {
// put your routes here
this.resource('profil', function() {
this.route('news');
this.route('menu');
});
});
App.MenuRoute = Ember.Route.extend({
renderTemplate: function() {
this.render({
into: 'profil/news',
outlet: 'menu',
});
}
});
而且index.html中我有:
<script type="text/x-handlebars" id="profil/news">
...
{{outlet}}
{{outlet menu}}
</script>
<script type="text/x-handlebars" id="menu">
...
</script>
'PROFIL /新闻' 被渲染,但模板 '菜单' 是不是在渲染模板全部:当我访问profil /新闻时,它应该在'profil/news'内部呈现。任何想法 ?
谢谢