Why resolve is not triggered in config?

Viewed 328

I have this config and controller in the module:

(function () {
  "use strict";
  angular.module("dashboard", ["ui.router",
      "clients",
      "sites",
      "regions",
      "beddingTypes",
      "geomindCommon",
    ])
    .config([
      "$stateProvider",
      function ($stateProvider) {
        $stateProvider
          .state("home", {
            url: "/Menu",
            templateUrl: "app/dashboard/templates/dashboard.tmpl.html",
            resolve: {
              client: ['$window', 'dashboardService', 'config', clientMapResolver],
            }
          });
      }
    ])
    .controller('dashboardController', ['$scope', 'config',
      function ($scope, config) {
        $scope.currClientId = config.currClient.id;
      }
    ])

  function clientMapResolver($window, dashboardService, config) {
    var layoutId = $window.parent.parent.parent.location.search.split('=')[1];
  }
})();

As you can see I have defined resolve in config state. But resolve is never triggered and clientMapResolver function is never called.

UPDATE: Maybe this can cause the issuse:

The project is SPA project.The dashboard is main module. I noticed that in my index page I have this diclaration:

<body ng-app="dashboard" ng-strict-di>
    <div ng-controller="dashboardController">
        <div class="sizeResponsive navbar navbar-green navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                      </button>
                </div>
            </div>
        </div>           
 </div>  

Any idea why resolve is never triggered?

4 Answers
Related