user2284341
user2284341

Reputation: 671

"Failed to instantiate module jobApp due to: Error: [$injector:modulerr] "

I have a .js file with this line:

var module = angular.module('jobApp', ['ui.bootstrap', 'ui.grid', 'ui.grid.selection', 'ui.grid.autoResize', 'ui.grid.resizeColumns'])

The module 'jobApp' is not loading. In a ascx file, I've referenced it like this:

    <div ng-app="jobApp" id="job">
    <div>
        <div ng-controller="jobCtrl" ng-init="onLoad('entity')">
        .
        .
</div>
     </div>
 </div>

When I use the dev tools in IE, I see an error 'SCRIPT5022'. After clicking on the link I see the error in more detail:

"Failed to instantiate module jobApp due to: Error: [$injector:modulerr] http://errors.angularjs.org/1.4.10/$injector/modulerr?p0=..."

I've tried including 'ng_route' module while including a reference to angular-route, as suggested by SO but jobApp is still not loading. Why is this not loading?

Upvotes: 1

Views: 99

Answers (2)

user2284341
user2284341

Reputation: 671

The problem was the ui-bootstrap file wasn't being referenced. All I needed to do was add </script> in my ascx file. Apologies to Dhara and Dale for not posting a better question. I should have been more clear as to what the problem was.

Upvotes: 1

Dhara Vaghasiya
Dhara Vaghasiya

Reputation: 298

I got this error so many times.Sometimes this error show because your angular.js file is not included properly . check your cdn of angular.js load properly. and then try to run program

Upvotes: 3

Related Questions