user1260928
user1260928

Reputation: 3429

Angularjs: missing dependency

When I launch my angularjs application I am getting this error

Uncaught Error: [$injector:nomod] Module 'App' is not available! You
either misspelled the module name or forgot to load it. If registering
a module ensure that you specify the dependencies as the second
argument. http://errors.angularjs.org/1.3.11/$injector/nomod?p0=App

As I have about 20 dependencies. How can I know which dependency is not satisfied?

angular.module('myApp', ['LocalStorageModule', 'tmh.dynamicLocale','ngResource', 'ui.router',   
'ngCookies','pascalprecht.translate', 'ngCacheBuster', 'ngTable',   
'ngSanitize','ui.select','angularValidator','ui.bootstrap','googlechart',   
'ui.bootstrap.showErrors','ngActivityIndicator','ncy-angular-breadcrumb',
'anguFixedHeaderTable', 'ui.utils','io.dennis.contextmenu'])

Upvotes: 0

Views: 744

Answers (2)

sics
sics

Reputation: 1318

Angular is trying to load a module called app. As your code looks like, you define your module name as myApp - so just rename one of them to archieve name equality.

EG:

angular.module('app', ['LocalStorageModule', 'tmh.dynamicLocale','ngResource', 'ui.router',   
'ngCookies','pascalprecht.translate', 'ngCacheBuster', 'ngTable',   
'ngSanitize','ui.select','angularValidator','ui.bootstrap','googlechart',   
'ui.bootstrap.showErrors','ngActivityIndicator','ncy-angular-breadcrumb',
'anguFixedHeaderTable', 'ui.utils','io.dennis.contextmenu'])

Upvotes: 4

Brad
Brad

Reputation: 4553

I don't think this is a dependency issue but simply a naming issue. Make sure your ng-app statement is correct in your HTML. By the looks of it your statement is probably ng-app="App" instead of ng-app="myApp".

Upvotes: 1

Related Questions