这是我的HTML代码:
<!DOCTYPE html>
<html lang ="en-Us">
<head>
<title>Angular SPA</title>
<meta chafset ="UTF-8" meta name="viewport" content= "width=device-width, initial-scale= 1.0">
<link rel = 'stylesheet' href = 'style.css'/>
<script src = "angular-1.6.9\angular.min.js"></script>
<script src = "angular-1.6.9\angular-route.js"></script>
<script src= "trial.js"></script>
</head>
<body ng-app ="myApp">
It is a fact that the best programmers are:
<p><a href ="#men">Men</a></P>
<p><a href ="#women">Women</a></P>
<div ng-view></div>
</body>
</html>
这是审判。js公司:
var ra = angular.module('myApp',['ngRoute']);
ra.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/men', {
template: '<h1>Of course, So true</h1>'})
.when('/women', {
templateUrl: 'test.html'});
}]);
这个主要问题是路由不工作。相反,我得到:
http://localhost/set%201/#!#men
页面上没有任何更改。我使用Angular js 1.6.9,所有代码(包含的文件夹)都与我的索引位于同一目录中。html。请帮忙!