源码
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>AngularJS路由使用 </title>
<script type="text/javascript" src="../js/angular.min.js" ></script>
<script type="text/javascript" src="../js/angular-route.min.js" ></script>
</head>
<body ng-app="myapp">
<div>
<h1>HEAD</h1>
<a href="#/JavaEE">JavaEE</a>
<a href="#/IOS">IOS</a>
<a href="#/Android">Android</a>
</div>
<!-- 路由加载后,更新变化的内容 -->
<div ng-view>
</div>
<div>
<h1>FOOT</h1>
</div>
</body>
<script type="text/javascript">
// 定义 myapp 模块
var myapp = angular.module("myapp",["ngRoute"]);
// 配置模块的路由
myapp.config(["$routeProvider", function($routeProvider){
$routeProvider
.when('/JavaEE', {
templateUrl: '5_1.html'
}).when('/IOS', {
templateUrl: '5_2.html'
}).when('/Android', {
templateUrl: '5_3.html'
}).otherwise({
redirectTo: '/JavaEE'
});
}]);
</script>
报错信息 现在全页面 route.min.js:14 不能使用 求解??
angular-route.min.js:14 Uncaught TypeError: d.$$minErr is not a function
at angular-route.min.js:14
at angular-route.min.js:15
angular.min.js:60 Error: Unknown provider: $templateRequestProvider <- $templateRequest <- $route <- ngViewDirective
at http://127.0.0.1:8020/bos_fore/src/main/webapp/js/angular.min.js:28:350
at Object.c [as get] (http://127.0.0.1:8020/bos_fore/src/main/webapp/js/angular.min.js:26:138)
at http://127.0.0.1:8020/bos_fore/src/main/webapp/js/angular.min.js:28:431
at c (http://127.0.0.1:8020/bos_fore/src/main/webapp/js/angular.min.js:26:138)
at Object.d [as invoke] (http://127.0.0.1:8020/bos_fore/src/main/webapp/js/angular.min.js:26:272)
at http://127.0.0.1:8020/bos_fore/src/main/webapp/js/angular.min.js:28:449
at c (http://127.0.0.1:8020/bos_fore/src/main/webapp/js/angular.min.js:26:138)
at Object.d [as invoke] (http://127.0.0.1:8020/bos_fore/src/main/webapp/js/angular.min.js:26:272)
at http://127.0.0.1:8020/bos_fore/src/main/webapp/js/angular.min.js:36:187
at Array.forEach (native) |
|