的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