【发布时间】:2014-01-15 12:37:00
【问题描述】:
我的应用程序将有一个侧边栏,其内容会根据当前路线而变化。因此,如果有人访问account,侧边栏上的内容将不同于有人访问members。
我尝试使用 accounts 路由来执行此操作,但遇到了问题。我正在使用此代码
Dashboard.AccountRoute = Ember.Route.extend({
renderTemplate: function() {
this.render('account_choices', {
outlet: 'choices',
into: 'sidebar'
})
}
});
我的application 模板是:
{{render header}}
{{render sidebar}}
<div id="outlet" class="main">
{{outlet}}
</div>
而我的sidebar 模板是:
<div class="sidebar">
{{outlet choices}}
</div>
但它不会将account_choices 渲染到sidebar 模板中的出口choices。它还会产生错误Assertion failed: Error while loading route: TypeError: Cannot call method 'connectOutlet' of undefined。
如何将account_choices 模板渲染到sidebar 中的choices 插座?
【问题讨论】:
标签: ember.js