的index.html
<div ui-view></div>
的test.html被裝載的index.html的UI視圖
和測試的內部。 HTML
<div ui-view="content"></div>
,並試圖加載另一個HTML文件,但它不工作
這裏是我的UI路由器
.state("index", {
url: "",
templateUrl: "views/index.html",
controller : 'MainCtrl',
controllerAs : 'main'
})
.state("test", {
url: "/test",
templateUrl: "views/test.html",
controller : 'testCtrl',
controllerAs : 'test'
})
.state("test.another", {
url : "another/",
views:{
'content':{
templateUrl :'views/another.html'
}
}
})
所以基本上是我想到的是
<div ui-view>
<!-- test.html -->
<div ui-view="test">
<!-- another.html -->
</div>
</div>
從'test.another'中刪除'views/test.html'。它應該只是爲了意見。所以第一個不是必需的。另外,「另一個@ post」是什麼? AFAIK在你的任何'ui-view'上都沒有這個標籤。 – cst1992
請勿更改所有代碼並刪除您的所有評論。否則沒有人會知道我在說什麼。 – cst1992