Reputation: 118
I've tried to pass one parameter white $stete.go.
$stateProvider.state('login.signin', {
url: '/signin',
params: {
login_event: ''
},
templateUrl: "assets/views/login_login.html",
title: 'Login',
resolve: loadSequence('moment', 'userLoginCtrl')
});
$state.go('login.signin', { login_event: "session_expired"});
console.log('toParams: ');
console.log(toParams);
console.log('fromParams: ');
console.log(fromParams);
console.log('$stateParams: ');
console.log($stateParams);
console.log('$state.params: ');
console.log($state.params);
Even if I pass a value in calling, the value I get in "toParams" is always the default value.
I've tried many many time to get a value, but "toParams" have only the default value.
Thanks for help.
Upvotes: 1
Views: 416
Reputation: 136144
You current implementation(shorthand implementation) of params
object, which will not consider the parameter pass from the $stateParms
, it will default value of login_event
to ''
. You should change your params
object implementation so that default value would be ''
like value: ''
if its not passed.
Code
params: {
login_event: {
value: ''
}
},
Upvotes: 1