title: AngularJS injecting third party module ngIdle
body: <p>I have a controller as shown below.</p>
  
  <pre><code>(function () {
  "use strict";
  var app = angular.module('Demo')
      .controller('MainController', ['$rootScope', '$scope', '$location', 'curUser',MainController]);
  
  
   function MainController($rootScope, $scope,  $location, curUser) {
         //some logic here  
   }());
  </code></pre>
  
  <p>I tried to include a third party module called ngIdle and the resultant code looks like below.</p>
  
  <pre><code>(function () {
  "use strict";
  var app = angular.module('Demo', ['ngIdle'])
      .controller('MainController', ['$rootScope', '$scope', '$location', 'curUser','Idle', function ($rootScope, $scope, $location, curUser, Idle) {
  
  
      }]).config(function (IdleProvider, KeepaliveProvider) {
          // configure Idle settings
          IdleProvider.idle(5); // in seconds
          IdleProvider.timeout(5); // in seconds
          KeepaliveProvider.interval(2); // in seconds
      })
      .run(function (Idle) {
          // start watching when the app runs. also starts the Keepalive service by default.
          Idle.watch();
      });
  
  }());
  </code></pre>
  
  <p>Now I get an error as Error: [$injector:unpr] Unknown provider: curUserProvider &lt;- curUser &lt;- MainController. Here's the curUser factory definition</p>
  
  <pre><code>    (function () {
      "use strict";
          angular.module("services").factory("curUser", curUser)
             function curUser() {}
      }());
  </code></pre>