可能是整個佈局錯了,但這裏是我的情況,我正在使用Angular ui-router的Meanjs.org堆棧。Angular ui路由器重載ng-include外部ui-view
我有一個佈局是這樣的:
<div data-ng-include="'/modules/core/views/header.client.view.html'"></div>
<div id="page-content" class="clearfix" fit-height>
<div id="wrap" data-ui-view="" class="mainview-animation"></div>
</div>
現在我需要重新加載控制器header.client.view.html內部時,我改變$狀態。
例如,當我在登錄頁面並登錄時,我需要重新加載頭控制器,但由於ui-router僅使用相對模板更改了ui-view部件,因此無法執行此操作:
// this change only ui-view, doesn't care about the ng-include before
state('home', {
url: '/',
templateUrl: 'modules/core/views/home.client.view.html',
});
我發現的可能性更多的UI視圖添加到狀態,所以我可以用於報頭添加的UI-視圖2代替使用納克 - 包括但此是指具有在每個狀態下的UI的視圖2。
有什麼建議嗎?