title: Error: [$rootScope:infdig] http://errors.angularjs.org/1.4.1/$rootScope
body: <p>I have the error below on my app</p>
  
  <pre><code>Error: [$rootScope:infdig] http://errors.angularjs.org/1.4.1/$rootScope/infdig?p0=10&amp;p1=%5B%5D
     at m.prototype.$digest (https://localhost:44301/angular.min.js:132:501)
     at m.prototype.$apply (https://localhost:44301/Scripts/angular.min.js:135:159)
     at Anonymous function (https://localhost:44301/Scripts/angular.min.js:19:315)
     at e (https://localhost:44301/Scripts/angular.min.js:39:10)
     at d (https://localhost:44301/Scripts/angular.min.js:19:236)
     at zc (https://localhost:44301/Scripts/angular.min.js:20:23)
     at Yd (https://localhost:44301/Scripts/angular.min.js:18:342)
     at Anonymous function (https://localhost:44301/Scripts/angular.min.js:289:159)
     at j (https://localhost:44301/js/jquery/jquery-2.1.1.min.js:2:26852)
     at k.fireWith (https://localhost:44301/js/jquery/jquery-2.1.1.min.js:2:27609)
  </code></pre>
  
  <p>its only throw once when the app starts, and after I login to my active directory the app works fine across all views.</p>
  
  <p>My app.js is like this:</p>
  
  <pre><code>(function () {
      angular.module('inspinia', [
          'ui.router',                    // Routing
          'oc.lazyLoad',                  // ocLazyLoad
          'ui.bootstrap',                 // Ui Bootstrap
          'pascalprecht.translate',       // Angular Translate
          'ngIdle',                       // Idle timer
          'AdalAngular',                  // ADAL JS Angular
          'ngRoute'                       // Routing
      ])
  })();
  </code></pre>
  
  <p>and part of my config.js</p>
  
  <pre><code>function config($stateProvider, $urlRouterProvider, $ocLazyLoadProvider, IdleProvider, KeepaliveProvider, adalAuthenticationServiceProvider, $httpProvider) {
  
      // Configure Idle settings
      IdleProvider.idle(5); // in seconds
      IdleProvider.timeout(120); // in seconds
  
      $urlRouterProvider.otherwise("/dashboards/dashboard_1");
  
      $ocLazyLoadProvider.config({
          // Set to true if you want to see what and when is dynamically loaded
          debug: true
      });
  
      $stateProvider
  
          .state('dashboards', {
              abstract: true,
              url: "/dashboards",
              templateUrl: "views/common/content.html",
  
          })
          .state('dashboards.dashboard_1', {
              url: "/dashboard_1",
              templateUrl: "views/dashboard_1.html",
              requireADLogin: true,
              resolve: {
                  loadPlugin: function ($ocLazyLoad) {
                      return $ocLazyLoad.load([
                          {
  
                              serie: true,
                              name: 'angular-flot',
                              files: ['js/plugins/flot/jquery.flot.js', 'js/plugins/flot/jquery.flot.time.js', 'js/plugins/flot/jquery.flot.tooltip.min.js', 'js/plugins/flot/jquery.flot.spline.js', 'js/plugins/flot/jquery.flot.resize.js', 'js/plugins/flot/jquery.flot.pie.js', 'js/plugins/flot/curvedLines.js', 'js/plugins/flot/angular-flot.js', ]
                          },
                          {
                              name: 'angles',
                              files: ['js/plugins/chartJs/angles.js', 'js/plugins/chartJs/Chart.min.js']
                          },
                          {
                              name: 'angular-peity',
                              files: ['js/plugins/peity/jquery.peity.min.js', 'js/plugins/peity/angular-peity.js']
                          }
                      ]);
                  }
              }
          })
  
   adalAuthenticationServiceProvider.init(
             {instance: 'https://login.microsoftonline.com/',
                 tenant: 'mysaasapp.onmicrosoft.com',
                 clientId: '33e037a7-b1aa-42ab-9693-6c22d01ca338',
                 extraQueryParameter: 'nux=1'
                 //cacheLocation: 'localStorage', // enable this for IE, as sessionStorage does not work for localhost.
             },
             $httpProvider
             );
  }
  angular
      .module('inspinia')
      .config(config)
      .run(function ($rootScope, $state) {
          $rootScope.$state = $state;
      });
  </code></pre>
  
  <p>My index.html</p>
  
  <pre><code>&lt;!--
  * INSPINIA - Responsive Admin Theme
  * Version 2.0
  *
  --&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html ng-app="inspinia"&gt;
  
  &lt;head&gt;
  
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
  
      &lt;!-- Page title set in pageTitle directive --&gt;
      &lt;title page-title&gt;&lt;/title&gt;
  
      &lt;!-- Font awesome --&gt;
      &lt;link href="font-awesome/css/font-awesome.css" rel="stylesheet"&gt;
  
      &lt;!-- Bootstrap --&gt;
      &lt;link href="css/bootstrap.min.css" rel="stylesheet"&gt;
  
      &lt;!-- Main Inspinia CSS files --&gt;
      &lt;link href="css/animate.css" rel="stylesheet"&gt;
      &lt;link id="loadBefore" href="css/style.css" rel="stylesheet"&gt;
  
  
  &lt;/head&gt;
  
  &lt;!-- ControllerAs syntax --&gt;
  &lt;!-- Main controller with serveral data used in Inspinia theme on diferent view --&gt;
  &lt;body ng-controller="MainCtrl as main"&gt;
  
  &lt;!-- Main view  --&gt;
  &lt;div ui-view&gt;&lt;/div&gt;
  
  &lt;!-- jQuery and Bootstrap --&gt;
  &lt;script src="js/jquery/jquery-2.1.1.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/jquery-ui/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;script src="js/bootstrap/bootstrap.min.js"&gt;&lt;/script&gt;
  
  &lt;!-- MetsiMenu --&gt;
  &lt;script src="js/plugins/metisMenu/jquery.metisMenu.js"&gt;&lt;/script&gt;
  
  &lt;!-- SlimScroll --&gt;
  &lt;script src="js/plugins/slimscroll/jquery.slimscroll.min.js"&gt;&lt;/script&gt;
  
  &lt;!-- Peace JS --&gt;
  &lt;script src="js/plugins/pace/pace.min.js"&gt;&lt;/script&gt;
  
  &lt;!-- Custom and plugin javascript --&gt;
  &lt;script src="js/inspinia.js"&gt;&lt;/script&gt;
  
  &lt;!-- Main Angular scripts--&gt;
  &lt;script src="Scripts/angular.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/oclazyload/dist/ocLazyLoad.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/angular-translate/angular-translate.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/ui-router/angular-ui-router.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.angularjs.org/1.2.25/angular-route.js"&gt;&lt;/script&gt;
  &lt;script src="js/bootstrap/ui-bootstrap-tpls-0.12.0.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/plugins/angular-idle/angular-idle.js"&gt;&lt;/script&gt;
  
  &lt;!--
   You need to include this script on any page that has a Google Map.
   When using Google Maps on your own site you MUST signup for your own API key at:
   https://developers.google.com/maps/documentation/javascript/tutorial#api_key
   After your sign up replace the key in the URL below..
  --&gt;
  &lt;script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDQTpXj82d8UpCi97wzo_nKXL7nYrd4G70"&gt;&lt;/script&gt;
  
  &lt;!-- Latest compiled and minified JavaScript --&gt;
  &lt;script src="js/adal/adal.min.js"&gt;&lt;/script&gt;
  &lt;script src="js/adal/adal-angular.js"&gt;&lt;/script&gt;
  
  &lt;!-- Anglar App Script --&gt;
  &lt;script src="js/app.js"&gt;&lt;/script&gt;
  &lt;script src="js/config.js"&gt;&lt;/script&gt;
  &lt;script src="js/translations.js"&gt;&lt;/script&gt;
  &lt;script src="js/directives.js"&gt;&lt;/script&gt;
  &lt;script src="js/controllers.js"&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and my content.html</p>
  
  <pre><code>&lt;!-- Wrapper--&gt;
  &lt;div id="wrapper"&gt;
  
      &lt;!-- Navigation --&gt;
      &lt;div ng-include="'views/common/navigation.html'"&gt;&lt;/div&gt;
  
      &lt;!-- Page wraper --&gt;
      &lt;!-- ng-class with current state name give you the ability to extended customization your view --&gt;
      &lt;div id="page-wrapper" class="gray-bg {{$state.current.name}}"&gt;
  
          &lt;!-- Page wrapper --&gt;
          &lt;div ng-include="'views/common/topnavbar.html'"&gt;&lt;/div&gt;
  
          &lt;!-- Main view  --&gt;
          &lt;div ui-view&gt;&lt;/div&gt;
  
          &lt;!-- Footer --&gt;
          &lt;div ng-include="'views/common/footer.html'"&gt;&lt;/div&gt;
  
      &lt;/div&gt;
      &lt;!-- End page wrapper--&gt;
  
      &lt;!-- Right Sidebar --&gt;
      &lt;div ng-include="'views/common/right_sidebar.html'"&gt;&lt;/div&gt;
  
  &lt;/div&gt;
  &lt;!-- End wrapper--&gt;
  </code></pre>
  
  <p>I was able to filter down the issue to something with ADAL.JS</p>
  
  <p>If I remove the requireadlogin line and the .init lines to configure authentication, the error is gone.</p>