1
Ember Community Assemble!emberjs - 有条件地在更大的模板中呈现模板
我想有条件地在application.hbs侧边栏内使用{{render''}}小模板,但该侧边栏的内容取决于我们路由到的模型的hbs。例如,“许可”边栏的内容与“个人资料”边栏的内容不同。
现在我只能一次渲染所有的侧栏内容,而不管选择什么model.hbs。
<!-- Right Sidebar in application.hbs START -->
<div id="sidebar-wrapper" class="super-super-float-right-col">
<div id="sidebar-wrapper" class="super-float-right-col">
<div id="sidebar-wrapper" class="float-right-col">
{{render 'applicant'}} <!-- only available to '/person/#' -->
{{render 'location'}} <!-- only available to '/permit/#' -->
</div>
</div>
</div>
<!-- Right Sidebar END -->
<div class="The rest of the content">
{{outlet}} <!--inserts the rest of the html into the main content container -->
</div>
我不希望这两个“申请人”和“位置”的,因为他们都高于同时呈现,而我希望将数据“申请”的内视的编号改变'人'。同样的关系适用于“位置”的“内部permit.hbs”
VpcYeoman.PermitRoute = Ember.Route.extend({
renderTemplate: function() {
this.render({ render:'location'});
}
});
Application_route.js是空白,现在
谢谢,迈克尔! currentSidebar是否暗示我还应该添加一个currentSidebar.hbs文件以在application.hbs中呈现? –
我刚刚检查过,它是1.2.0,“{{view someProperty}}”已被修复,并且它对** {{{render someProperty}}不起作用** –
作为替代方案,您会有什么建议? –