2
首先,道歉我沒有一個示例來顯示。目前的情況是我使用的UI路由器和我有3個不同的控制器,每個在同一頁上的狀態名稱'結果'的意見。即頭部,內容和側邊欄。
但是,當我呼叫$state.is('result')
時,只有1個控制器(內容)返回true
。我也試過$state.includes('result')
。
當我登錄了$state
只,所有3的狀態對象是否顯示在$state.current.name
同樣正確\result
,但是,如果我嘗試直接登錄$state.current
,該name
他們的2變爲空白。
我試着交換視圖的順序,但只有內容返回true
。
我多次閱讀文檔,但找不到原因。請幫忙!
.state('result', {
url: '/result',
views: {
'headView' : {
templateUrl: 'modules/core/templates/head.html'
},
'contentView' : {
templateUrl: 'modules/core/templates/content.html'
},
'sidebarView' : {
templateUrl: 'modules/core/templates/sidebar.html'
},
}
})