The code seems simple, but as I read the docs for $location, I notice there's a LOT of complexity I don't understand. My setup is as follows:
// in app.js
$routeProvider.when('/done' , {templateUrl: 'partials/done.html', controller: 'DoneController'});
// in my controller where $location is injected, on a button press...
if (!$scope.errors.length) {
$scope.model.save().then(function() {
alert("did I get here?");
$location.path('/done');
});
}
I press the button and see the alert, but no change in view. I press the button a second time (saving data to the cloud a second time), I see the alert a second time and the view does change. Any ideas why? Thanks in advance.