1

In the beginning of my html I've declare my application:

<html lang="en" ng-app="MyAppModule"> 

and at the bottom I have include all the necessary files, the Chrome does not complain for any missing file:

 <!-- Placed at the end of the document so the pages load faster --> <script src="js/jquery-1.11.0.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/angular.min.js"></script> <script src="js/angular-resource.min.js"></script> <script src="js/angular-route.min.js"></script> <script src="js/app.js"></script> <script src="js/Controllers/EventController.js"></script> <script src="js/Services/EventService.js"></script> <script src="js/filters.js"></script> 

Here is my application:

'use strict'; // Declare app level module which depends on filters, and services var MyAppModule = angular.module('MyAppModule', ['ngResource']).config(function($routeProvider){ $routeProvider.when('/mybooks',{ templateUrl:'/templates/mybooks.html', controller:'EventController' } ); }); 

But when I am trying to see the page there is a Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.14/$injector/modulerr?p0=MyAppModule&p1=Err…js.org%2F1.2.14%2F%24injector%2Funpr%3Fp0%3D%2524routeProvider%0A%20%20%20...<omitted>...2) on the browser. Any help? Am I missing something?

1 Answer 1

4

Try replacing this:

['ngResource'] 

With this:

['ngResource', 'ngRoute'] 

It looks like you're not injecting the route provider.

Sign up to request clarification or add additional context in comments.

1 Comment

yeah, you are right, I just notice it, silly mistake. Thank you.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.