0
var requestOne = $http({
                    method: 'POST',
                    url: $rootScope.apisrvr + 'user/user_signin',
                    data: { username: $scope.user.username, password: $scope.user.password },
                });

This is my code, when I write: console.log(requestOne); I get: that

I just want get $$state / value / data / salt. But when I try console.log(requestOne.$$state.value.data.salt); I get error TypeError: Cannot read property 'data' of undefined. How I can get salt from here?

1

1 Answer 1

1

The requestOne is the promise variable itself, to actually get the result, you need to add a .then call to the end of the promise like so:

var requestOne = $http({
                    method: 'POST',
                    url: $rootScope.apisrvr + 'user/user_signin',
                    data: { username: $scope.user.username, password: $scope.user.password },
                }).then(function(result){
                    console.log(result);
                });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.