Angular JS Uncaught Error: [$injector:modulerr]

ig-melnyk picture ig-melnyk · Jan 10, 2014 · Viewed 182.3k times · Source

I am having a problem with Angular JS receiving an error : Uncaught Error: [$injector:modulerr]. My JS-file looks

angular.module('MyApp', ['ngRoute']);
angular.module('MyApp',['ngResource']);
function TwitterCtrl($scope,$resource){
}

I also included angular-route-js

 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular.min.js">     
 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular-route.min.js">

Angular documentation says the problem is http://docs.angularjs.org/api/ngRoute

Answer

Lauri Elias picture Lauri Elias · Jan 10, 2014

Try adding this:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular-resource.min.js"></script>