【发布时间】:2020-07-19 14:38:55
【问题描述】:
所以我已经在部分视图中(..someURL.aspx?id=xx#/insidePartialOrTemplateView.html),我不在 index.html 中,如上所述。在这个局部视图内部是一些 div/navigation/buttons/,我想在其中加载其他视图。因此,在我目前的部分视图中,它就像一个全新的其他网站。
-------------------------------------
|profile | |
|settings| |
|gallery | load views here |
| | |
| | |
-------------------------------------
示例代码:
<script type="text/ng-template" id="user">
<nav>
<ul>
<li><a href=#/userProfile></a></li>
<li><a href=#/userSettings></a></li>
<li><a href=#/userGallery></a></li>
</ul>
</nav>
</script>
在这种情况下也用于路由
angular.module("PageRouting", ["ngRoute"])
.config(function ($routeProvider) {
$routeProvider
.when("/userProfile", {
templateUrl: "sample1.html"
})
.when("/userSettings", {
templateUrl: "sample2.html"
})
.when("/userGallery", {
templateUrl: "sample3.html"
})
})
有没有可能的解决方案?我正在使用角度 1.5。我是角度新手,什么都不知道。我不熟悉更高版本。
【问题讨论】:
标签: angularjs