When performing operations outside of AngularJS, such as making an AJAX call with jQuery or accessing geolocation data as shown in your example, it's important to notify Angular to update itself. After reviewing your jsFiddle, I made some changes to the code to achieve this:
var app = angular.module('myApp', []);
app.controller('RegisterCtrl', function($scope){
$scope.showLocation = false;
navigator.geolocation.getCurrentPosition(function(position){
$scope.showLocation = true;
$scope.$apply();
}, function(error){
$scope.showLocation = false;
$scope.$apply();
});
});
Now the showLocation variable updates correctly. For more information on using the $apply() method, refer to http://docs.angularjs.org/api/ng.$rootScope.Scope#$apply
jsFiddle http://jsfiddle.net/yLFNP/6/
Edit: My answer was edited, but I don't agree with the edit. While it is possible to condense the $apply method by wrapping it around individual scope updates to save characters, I prefer employing the $apply method after a series of logic instead of enclosing each statement within it. If there are multiple scope updates, you can either apply them separately like so:
$scope.$apply($scope.var1 = newValue1);
$scope.$apply($scope.var2 = newValue2);
$scope.$apply($scope.var2 = newValue3);
However, I find this approach excessive, and recommend utilizing the following function method:
$scope.$apply(function(){
$scope.var1 = newValue1;
$scope.var2 = newValue2;
$scope.var3 = newValue3;
});
Alternatively, you can apply it directly after the code that requires updating:
$scope.var1 = newValue1;
$scope.var2 = newValue2;
$scope.var3 = newValue3;
$scope.$apply();
Consistently employing this method ensures easily transferable and readable code. Remember, fewer lines of code isn't always optimal.