1
<script type="text/x-handlebars" data-template-name="application"> 
{{view App.UiMenuView}}
{{view App.UiMainContainerView}}
{{outlet}}
</script>

<script type="text/x-handlebars" data-template-name="uiMainContainer">
<div id="uiMainContainer">
<div id="uiMainContainerSidebar">
{{#view App.SidebarView}}
<ul id="uiMainContainerSidebarList">
<li><a {{bindAttr href="view.tasksUrl"}}>Tasks</a></li>
<li><a {{bindAttr href="view.milestonesUrl"}}>Milestones</a></li>
<li><a {{bindAttr href="view.projectsUrl"}}>Projects</a></li>
<li><a {{bindAttr href="view.customersUrl"}}>Customers</a></li>
</ul>
{{/view}}
</div>
<div id="uiMainContainerContainer">{{outlet}}</div>
</div>
</script>  

我想知道是否有办法专门解决outletfrom uiMainContainer?我试过类似的东西:

test: Em.Route.extend({
            route: '/test',
            connectOutlets: function(router) {
                //router.get('applicationController').connectOutlet({ name: 'test' });
                router.get('uiMainContainerController').connectOutlet({ name: 'test'});
            }
        })  

然而,这种方法似乎无济于事。

4

0 回答 0