let userRequest = $http({
method: 'POST',
url: $rootScope.apisrvr + 'user/user_signin',
data: { username: $scope.user.username, password: $scope.user.password },
});
Upon executing the code and logging console.log(userRequest);
, the output is displayed as:
this
My aim is to extract the value of $$state / value / data / salt
. However, attempting to access it via
console.log(userRequest.$$state.value.data.salt);
triggers an error message stating TypeError: Cannot read property 'data' of undefined
. How can I successfully retrieve the salt
from this object?