angularjsnode.jsng-idle

AngularJS Error - Failed to instantiate module ngIdle


I have an Angular app reporting a persistent error.

Failed to instantiate module ngIdle due to ...

Error: $injector:nomod
Module Unavailable
Module 'ngIdle' 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.

After manually adding module via npm install ng-idle, I keep getting the error in my browser. I even see angular idle dir in my node-modules directory.

How do I resolve this?

app.js declaration

var app =angular.module('app', ['ngResource', 'LocalStorageModule', 'ui.router', 'kendo.directives', 'datatables' , 'datatables.bootstrap', 'datatables.scroller',  'angularMoment', 'ngAnimate','ngIdle']);

Solution

  • My index.html was missing the following line

    <script src="resources/js/idlejs/angular-idle.js"></script>
    

    Adding the line resolved the error.