I have this controller for saving some details for an individual. I have a separate repository EntityRepository where a function to get the user gender from database is defi
Can you try this.
$scope.GetUserGender = function(){
EntityRepository.getUserGender().then(function(response){
$scope.userGender = response.data.gender;
console.log("inside : ", $scope.userGender);
}).catch(function(errorResponse) {
$scope.error = errorResponse.data
});
}
$scope.GetUserGender(); //
console.log("outside : ", $scope.userGender);
Hope this will work :)