시스템에서 일부 문제가 발생했습니다. 나는 다른 구성 요소를 보여주는 각도의 w3 학교 데모에서 배웠습니다. 여기각도가 올바르게 작동하지 않는 이유는 무엇입니까?
내가 노력하고 하나입니다
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-route.js"></script>
<body ng-app="myApp">
<p><a href="#/">Main</a></p>
<a href="#banana">Banana</a>
<a href="#tomato">Tomato</a>
<p>Click on the links to change the content.</p>
<p>The HTML shown in the ng-view directive are written in the template property of the $routeProvider.when method.</p>
<div ng-view></div>
<script>
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
template : "<h1>Main</h1><p>Click on the links to change this content</p>"
})
.when("/banana", {
template : "<h1>Banana</h1><p>Bananas contain around 75% water.</p>"
})
.when("/tomato", {
template : "<h1>Tomato</h1><p>Tomatoes contain around 95% water.</p>"
});
});
</script>
</body>
</html>
그것은 내 시스템에서 헤더 태그 사이를 전환하지 않습니다 여기에
http://www.w3schools.com/angular/tryit.asp?filename=try_ng_routing_template
내가 사용하고있는 코드입니다.편집 : 코드는 다른 시스템에서는 정상적으로 작동하지만 시스템에서는 정상적으로 작동하지 않습니다. 내 아파치 폴더에 있습니다. localhost를 실행 중입니다. 자바 스크립트, PHP 및 HTML 잘 작동합니다. 나는 jQuery도 사용했다. 각도가 문제가되는 이유는 무엇입니까?
내게 [plunkr here] (https://plnkr.co/edit/lXP6y1ZDT0sOvKPmn23a?p=preview), 서버에 파일을 호스팅했는지 확인하십시오. –
내 apache 폴더에 있습니다. localhost를 실행 중입니다. 자바 스크립트, PHP 및 HTML 잘 작동합니다. 나는 jQuery도 사용했다. 각도가 문제가되는 이유는 무엇입니까? – munchschair
아직 생각해 본 적이 있지만 이전 버전에서 로컬로 캐시 된 파일인지 확실하지 않습니까? 캐시를 지우고 브라우저를 다시 시작 하시겠습니까? –