0

Is it possible to configure providers with different values per module?

I am using ng-idle and would like to configure timeout for each module differently.

angular.module('module1').config(function($idleProvider){
   $idleProvider.warningDuration(5);
});

angular.module('module2').config(function($idleProvider){
   $idleProvider.warningDuration(10);
});

But module loaded first overrides the configuration.

Arulkumar
  • 12,966
  • 14
  • 47
  • 68
terafor
  • 1,620
  • 21
  • 28
  • 1
    Services are singleton in nature, so the configuration changes are global. Unless the service itself support such configuration, you are out of luck. – Chandermani Nov 03 '14 at 15:27
  • Thanks, i guess i can work around by catching event, increasing counter and restarting it... or modify plugin. – terafor Nov 04 '14 at 08:47

0 Answers0