我正在尝试通过Ember直接在<body>
标记下呈现标题元素,并且很难将其拉出b / c Ember将所有内容包装在主应用程序<div>
标记内。所以,我想要的是一个大致相同的文档结构:
<html>
<head>
...
</head>
<body>
<header>
... content inside here is controlled by ember application ...
</header>
<div class='container'>
... main content of the application ...
</div>
</body>
</html>
问题在于,如果我尝试在主应用程序模板中包含header
标记,它将被包装在应用程序div
中。有人知道怎么把它拉下来吗?
答案 0 :(得分:1)
如何使用指定商店?您的应用程序模板如下所示:
<header>
{{outlet header}}
</header>
<div class='container'>
{{outlet main}}
</div>
并在您的路线中:
App.ApplicationRoute = Ember.Route.extend({
renderTemplate: function() {
this.render({ outlet: 'header' });
this.render({ outlet: 'main' });
}
});