Skip to content Skip to sidebar Skip to footer

Angular Resolve: Variable Is Not Defined

I am working with Angular Routes for the first time and I recently posed a question regarding a refresh losing some data, the answer I received was to use resolve. It seems to be t

Solution 1:

The resolved properties are injected into your controller, so try this:

app.controller('teammateController', functionteammateController($scope, $http, $rootScope, $timeout, Idle, $location, activeDepartment) {
   $scope.deptName = activeDepartment;
 });

Notice the additional argument at the end of your controller.

Solution 2:

app.controller('teammateController', function teammateController($scope, $http, $rootScope, $timeout, Idle, $location) {
       $scope.deptName = activeDepartment();
     });

should be

app.controller('teammateController', function teammateController($scope, $http, $rootScope, $timeout, Idle, $location, activeDepartment) {
       $scope.deptName = activeDepartment;
     });

BTW, the syntax you're using is not going to work if you want to minify your code.

Post a Comment for "Angular Resolve: Variable Is Not Defined"