我正在创建一个有角度的应用程序,它不断发出此错误:
未捕捉错误:[$ injector:modulerr] http://errors.angularjs.org/1.4.9/ $ injector / modulerr?p0 = webinarApp& p1 =错误... 0c%20(https%3A%2F%2Fcode.angularjs.org%2F1.4.9% 2Fangular.min.js%3A19%3A463)
我在app.module中包含了用于ngRoute模块的cdn,ngRoute,定义了一个新的$ route提供程序,包括ng-view,
这是我的代码:
App.js
var webinarApp = angular.module('webinarApp', ['ngCookies', 'ngRoute']);
webinarApp.config(function($routeprovider){
$routeprovider
.when('/', {
templateUrl: './home.html',
controller: 'mainController'
})
.when('/signup', {
templateUrl: './signup.html',
controller: 'mainController'
})
});
webinarApp.controller('mainController', ['$scope', '$http', '$cookies', function($scope, $http, $cookies){
$scope.welcomeMessage = 'Hello from Angular';
$scope.users = [];
$scope.searchQuery = "";
$scope.orderByField = 'name';
$scope.newUser = {};
$scope.logInUser = {};
$scope.webinars = [];
$scope.newWebinar = {};
$scope.isDisabled = false;
// ============== Users ================
的index.html
<!DOCTYPE html>
<html lang="en" ng-app="webinarApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Find a Webinar</title>
<!-- Custom CSS -->
<link href="css/grayscale.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/signin.css" rel="stylesheet">
<script src="//code.angularjs.org/1.4.9/angular.min.js"></script>
<script src="//code.angularjs.org/1.4.9/angular-route.min.js"></script>
</head>
<body ng-controller="mainController" id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
<div class="container" ng-view></div>
</body>
</html>
答案 0 :(得分:1)
您拼写错误的服务名称:
$routeprovider
应该是
$routeProvider