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
You are not able to access the value outside due to asynchronous property of requests. What that simply means is that this statement: console.log("outside : ", $scope.userGender);, is getting executed before the .then(function(){ ... }).
Fixes:
$timeout.controller('individualDetailsCtrl', function($scope, $rootScope, $location, EntityRepository, $timeout) {
and
$timeout(function() {console.log("outside : ", $scope.userGender)});
$scope.userGender's value only inside the .then(function() { }).