0
controllerA甲如何使用参数而不显示在URL中?从状态
$state.go('account.accountRegister', {accountType: $stateParams.accountType, acName: acName})
状态app.js定义从状态B
.state('account.accountRegister', {
url: '/:accountType/register',
params: {accountType, acName},
views: {
'[email protected]':{
templateUrl: 'app/views/registration.html',
controller: 'registrationController'
}
}
})
controllerB
console.log($stateParams.acName); // is getting undefined
如何吨使用acName
他控制器没有显示在状态的url部分?
尝试givinng默认值状态PARAMS。 'params:{accountType:null,acName:null}' –
如果我提到'null'我放弃它的价值。 –