Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Properties undefined
Message
 
 
To
All
General information
Forum:
Javascript
Category:
Other
Title:
Properties undefined
Miscellaneous
Thread ID:
01606477
Message ID:
01606477
Views:
45
Hi everybody,

In one controller's code I have the following code
 app.config(['$stateProvider', function ($stateProvider) {
        $stateProvider.state('home', {
            url: '/',
            template: ''
        }).state('editDepartment', {
            url: '/edit/department/:id',
            controller: 'departmentCrudController',
            templateUrl: '/items/department/editform'
        }).state('editCategory', {
            url: '/edit/category/:departmentId/:categoryId',
            controller: 'categoryCrudController',
            templateUrl: '/items/category/editform'
        }).state('editItem', {
            url: '/edit/item/:departmentId/:categoryId/:itemId',
            controller: 'itemCrudController',
            templateUrl: '/items/item/editform'
        }).state('newDepartment', {
            url: '/new/department',
            controller: 'departmentCrudController',
            templateUrl: '/items/department/editform'
        }).state('newCategory', {
            url: '/new/category/:departmentId/:departmentNameHash',
            controller: 'categoryCrudController',
            templateUrl: '/items/category/editform'
        }).state('newItem', {
            url: '/new/item/:departmentId/:categoryId/:departmentNameHash/:categoryNameHash',
            controller: 'itemCrudController',
            templateUrl: '/items/item/editform'
        });
    }]);
and then in the CategoryController code I have
  var init = function () {
                $scope.showForm = false;
                $scope.disableAction = false;
                $scope.isEditLoading = false;
                load($stateParams.departmentId, $stateParams.categoryId,
                    $stateParams.departmentNameHash);
            };
and in the ItemController I have
 var init = function () {
            $scope.showForm = false;
            $scope.disableAction = false;
            $scope.isEditLoading = false;
            $scope.gridOptions = [];
            load($stateParams.departmentId, $stateParams.categoryId, $stateParams.itemId,
                $stateParams.departmentNameHash, $stateParams.categoryNameHash);
        };
In the category controller the $stateParams.departmentNameHash is correctly defined. But in the Item Controller both departmentNameHash and categoryNameHash are undefined and I can not figure out why is that and what is missing.

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform