I have encountered an issue where the location is not changing after a promise is returned.
function register() {
firebase.auth().createUserWithEmailAndPassword($scope.email, $scope.password)
.then(function (user) {
console.log(user);
UserService.setUser(user);
$location.path('/home');
})
.catch(function (error) {
$scope.message = error.message;
alert($scope.message);
});
}
It seems like the problem lies within the .then
function of the promise. I haven't found any documentation suggesting that $location cannot be used within a promise.
Even though the console displays the newly created user and there are no errors thrown.