我想使用AngularJS的多個視圖使用ng-view和routeProvider,但它不工作。能否請你幫忙?以下是鏈接到我的整個項目普拉克:如何使用ng-view和routeProvider加載多個視圖?
下面是index.html頁面:
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8" />
<title>AngularJS Routing</title>
<script data-require="[email protected]" data-semver="1.4.8" src="https://code.angularjs.org/1.4.8/angular.js"></script>
<script data-require="[email protected]*" data-semver="1.4.8" src="https://code.angularjs.org/1.4.8/angular-route.js"></script>
<link rel="stylesheet" href="css/app.css" />
</head>
<body>
<ul class="menu">
<li>
<a href="#/view1.html">view1</a>
</li>
<li>
<a href="#/view2.html">view2</a>
</li>
</ul>
<div>Below you should see the partial view :) ... </div>
<div ng-view>
<p>ng-view should be loading data from view1.html and view2.html right here but it's not working</p>
</div>
<script src="app.js"></script>
<script src="controllers.js"></script>
</body>
</html>
http://stackoverflow.com/questions/17544558/multiple-ng-view-in-single-template-angular-js –