grbsk / ng-idle

Responding to idle users in AngularJS applications.
http://hackedbychinese.github.io/ng-idle
MIT License
564 stars 195 forks source link

AngularJs - Unknown provider : IdleProvider #218

Closed mohitraghav773 closed 6 years ago

mohitraghav773 commented 6 years ago

Getting this when I tried to inject this into my code. Error occurs when tried to add "app.run(['Idle', function(Idle)" Can you please help me Why I'm getting this issue. When I checked few other references it was saying to migrate from $idleproder to IdleProvider.

var errorDisplay= angular.module('errorDisplay', ['ui.bootstrap', 'ngIdle']).config(config);

config.$inject = ['KeepaliveProvider', 'IdleProvider']; function config(KeepaliveProvider, IdleProvider) { IdleProvider.idle(5); IdleProvider.timeout(5); KeepaliveProvider.interval(10); }

mohitraghav773 commented 6 years ago

app.directive('userInfo', function() { return { templateUrl: 'userInfo.html' } });

errorDisplay.directive('userInfo', function() { return { templateUrl: 'userInfo.html' } });

Was using errorDisplay instead of app