Error: $ injector: modulerr Module error using ui-router

I can not understand what the problem is

div#wrapper(ng-app="adminApp") .... 

Js /

 var adminApp = angular.module('adminApp', ['ui-router']); 

if i use

 var adminApp = angular.module('adminApp', []); 

the error disappears

why?

UPDATE:

add image from console

enter image description here

+8
javascript angularjs angular-ui-router
source share
3 answers

the name of the ui-router module, but you need to enter ui.router , not ui-router

 var adminApp = angular.module('adminApp', ['ui.router']); 

check plunker link

+23
source share

A little late, but maybe it will save time. In my case, I messed up the links: instead of angular-ui-router.min.js I downloaded angular-route.min.js . Obviously, angular -ui-router is required for this.

+3
source share

I also had a similar problem, and in addition to the following steps described above, "entre", I had to make sure that the angularjs script tag is before the ui-router tag itself:

 <script src="Scripts/angular.min.js" type="text/javascript"></script> <script src="scripts/angular-ui-router.min.js" type="text/javascript"></script> 

The reverse order will also call $ injector: modulerr

+2
source share

All Articles