How to send parameters in Angularjs $state.go?
You need to have those as params
in order to be able to send them through state
. Like this:
$stateProvider
.state('Registration.OTPVerification', {
url: '/RegistrationOTPVerification',
params: {
customerid: null,
OTP: null
},
templateUrl: 'Registration/RegistrationOTP.html',
controller: 'RegistrationOTPVerification'
});
Now, you can use $state.go
like following:
$state.go('Registration.OTPVerification', {
customerid: 123,
OTP: 2323
});
Finally, you can access them way you are using $stateParams.customerid
and $stateParams.OTP
but make sure you have $stateParams
injected just like you have $state
and $translate
injected.