I am developing AngularJS application. I am trying to send values in $state.go to different states. I am trying as below.
This is my state:
$stateProvider
.state('Registration.OTPVerification', {
url: '/RegistrationOTPVerification',
templateUrl: 'Registration/RegistrationOTP.html',
controller: 'RegistrationOTPVerification'
});
I am trying as below.
var customerid = response.data.ID;
var OTP = response.data.OTP;
$state.go('Registration.OTPVerification', customerid,OTP);
I am trying to receive parameters in below controller.
(function () {
angular.module('RoslpApp').controller('RegistrationOTPVerification', ['$scope', '$http', '$translatePartialLoader', '$translate', '$state', function ($scope, $http, $translatePartialLoader, $translate, $state, $stateParams) {
var customerid = $stateParams.customerid;
var OTP = $stateParams.OTP;
alert(customerid);
}]);
})();
I am not able to receive parameters. Any help would be appreciated. Thank you.