我知道有关于这个主题的多个主题,但即使有这些主题的答案,我的测试也行不通。
我试图添加Angular Route JS file 并将它放在我的Angular文件之后的HTML中。 我仍然得到同样的错误。
错误: 错误:[$ injector:modulerr] http://errors.angularjs.org/1.3.16/ $ injector / modulerr?p0 = App& p1 =%5B%24injector%3Aunpr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.3.16%2F %24injector%2Funpr%3Fp0%3D%2524routProvider%0AF%2F%3C%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A6%3A417%0Abb %2FR。%24injector%3C%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A38%3A7%0AD%40https%3A%2F%2Fajax。 googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A36 3A13%%%0AE%40https 3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular。 min.js%3A36%3A283%0AD%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A34%3A490%0Ag%2F%3C%40https% 3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A35%3A117%0Aq%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs% 2F1.3.16%2Fangular.min.js%3A7%3A320%0Ag%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1。 3.16%2Fangular.min.js%3A34%3A399%0Abb%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A38%3A135%0Axc%2FD% 40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A17%3A381%0Axc%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs% 2Fangularjs%2F1.3.16%2Fangular.min.js%3A18%3A179%0AOd%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A17%3A1% 0A%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A251%3A429%0AA%40https%3A%2F%2Fajax.googleapis.com%2Fajax% 2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js%3A165%3A93%0Aqf%2FC%40https%3A%2F%2Fajax.googleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.16%2Fangular.min.js% 3A32%3A384%0A
var App = angular.module('App', ['ngRoute']);
App.config(function ($routProvider) {
$routeProvider.
when('/',
{
templateUrl: 'partials/list.html'
})
});
App.controller('ProjectListCtrl', function ($scope) {
$scope.projects = [
{
'title': 'Loook',
'category': 'Kleding app, Logo'
}
];
});
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="fonts/fonts.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<section ng-app="App" ng-controller="AppCtrl">
<a href="/">Overzicht</a>
<ng-view></ng-view>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script>
<script src="https://raw.githubusercontent.com/angular/bower-angular-route/master/angular-route.js"></script>
</body>
</html>
答案 0 :(得分:0)
您关联的文件:https://raw.githubusercontent.com/angular/bower-angular-route/master/angular-route.js。对于angularjs 1.3.17(你可以在评论的顶部看到它)。你使用的角度是1.3.16,那里存在冲突。除此之外,你可以粘贴你得到的实际错误吗?
作为旁注,您可以使用:https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular-route.min.js