view1과 view2를로드하기 위해 AngularJS UI 라우터를 사용하려하지만 index.html 페이지로로드되지 않습니다. 좀 도와 줄 수있어?AngularJS UI Router를 사용하는 방법?
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8" />
<title>AngularJS Routing</title>
<script data-require="[email protected]*" data-semver="2.0.0" src="https://code.angularjs.org/2.0.0-beta.6/angular2.min.js"></script>
<script data-require="[email protected]*" data-semver="1.0.0-alpha.5" src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/1.0.0-alpha.5/angular-ui-router.js"></script>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<ul class="menu">
<li>
<a ui-sref="view1">view1</a>
</li>
<li>
<a ui-sref="view2">view2</a>
</li>
<li>
<a ui-sref="index">Home</a>
</li>
</ul>
<div>Below you should see the partial view :) ... </div>
<div ng-view="">
<p>ng-view should be loading data from about.html right here but it's not working</p>
</div>
<script src="app.js"></script>
<script src="controllers.js"></script>
</body>
</html>
당신은 잘못된 마크 업이 (각도
ngRoute
라우팅 API는 이것을 사용)ui-view
대신ng-view
해야한다 :This is the link to whole project in Plunker
또한 아래의 index.html 페이지 코드입니다. ng-view 대신 ui-view를 사용하십시오. – Markus