【发布时间】:2013-11-25 16:41:38
【问题描述】:
我想在模板“许可”的边栏中呈现模板“位置”。 我的代码是 emberjs.com 的渲染模板示例中显示的代码的副本,但“位置”模板要么根本不加载,要么仅重复加载“位置”模板,但未在“许可”中渲染原始 html模板。因此 location.hbs 会显示,但不在分配给它的侧边栏中。
这是一些代码:D
<!-- Right Sidebar (a small piece of the 'permit' template) 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">
{{outlet location}}
</div>
</div>
</div>
<!-- Right Sidebar END -->
VpcYeoman.PermitRoute = Ember.Route.extend({
renderTemplate: function() {
this.render('location');
}
});
路由器.js
VpcYeoman.Router.map(function () {
...
this.resource('permit', { path: '/permit/:permit_id' });
...
});
http://emberjs.com/guides/routing/rendering-a-template/ 再次变得含糊不清,帮助不大。
emberjs 社区集合!
【问题讨论】:
标签: templates ember.js routes rendering router