0

谁能帮我解决这个问题我有一个关于参数的问题:

1)当我进入解析功能app.usermanagement.user({id:40})时是空的。我想我错过了一些选择。router.config$stateParams

我要去那个状态ui-sref="app.usermanagement.user({id:40})"

下面是代码:

var states = [];

states.push({
    name: 'app',
    url: '/',
    deepStateRedirect: true,
    resolve: {
        languages: function (CommonData) {
            return CommonData.getLanguages();
        },
        r1s: load([
            'ui.select'
        ]).deps
    },
    views: {
        '@': {
            templateUrl: 'tpl/app.html'
        }
    }});
states.push({
    name: 'app.usermanagement',
    url: 'userManagement',
    templateUrl: 'app/views/user-managment.html',
    controller:'UserManagmentController',
    deepStateRedirect: { default: "app.usermanagement.search" }
});
states.push({
    name: 'app.usermanagement.search',
    url: '/search',
    templateUrl: 'app/views/tabs/user-managment/user-search.html',
    controller:'UserSearchController'
});
states.push({
    name: 'app.usermanagement.user',
    url: '/user/{id}',
    controller:'UserPageController',
    templateUrl: 'app/views/tabs/user-managment/user-page.html',
    resolve: {
        user: function ($stateParams, UserData) {
            return UserData.getUserById($stateParams.id);
        }
    },
    deepStateRedirect: { default: "app.usermanagement.user.details" }
});
states.push({
    name: 'app.usermanagement.user.details',
    url: '/details',
    controller:'UserDetailsController',
    templateUrl: 'app/views/tabs/user-managment/user-details.html'
});
states.push({
    name: 'app.usermanagement.user.friends',
    url: '/friends',
    templateUrl: 'app/views/tabs/user-managment/user-friends.html'
});
4

1 回答 1

1

好的,我在 deepStateRedirect 对象中缺少属性参数:true

deepStateRedirect: { default: "app.usermanagement.user.details", params:true }
于 2016-02-25T16:45:13.167 回答