Angular: I keep getting this error on injector modulerr

I am making an angular app and it keeps giving this error:

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.9/$injector/modulerr?p0=webinarApp&p1=Error…0c%20(https%3A%2F%2Fcode.angularjs.org%2F1.4.9%2Fangular.min.js%3A19%3A463)

I have included the cdn for ngRoute module, ngRoute in app.module, defined a new $route provider, included ng-view,

Here is my code:

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>

Answers:

Answer

You misspelled service name:

$routeprovider

should be

$routeProvider

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us Javascript

©2020 All rights reserved.