使用$ routeProvider,$ locationProvider处理角度路由。路由工作正常,但刷新页面“HTTP错误404.0 - 未找到”即将到来。请帮忙
标记
<!DOCTYPE html>
<html ng-app="myApp" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Routing</title>
<script src="angular/angular.js"></script>
<script src="angular/angular-route.min.js"></script>
<script src="script/script.js"></script>
<base href="/">
</head>
<body>
<ul>
<li><a href="home">Home</a></li>
<li><a href="about">About</a></li>
</ul>
<div ng-view></div>
</body>
</html>
脚本
var myApp = angular.module("myApp", ['ngRoute']);
myApp.config(function ($routeProvider, $locationProvider) {
$routeProvider
.when("/", {
templateUrl: "pages/home.html"
})
.when("/about", {
templateUrl: "pages/about.html"
})
$locationProvider.html5Mode(true);
})
由于