I am trying to create a controller function to submit a signup with firebase, but it seems that the variables from the scope (controllerAs: $reg) are not binding when they are updated inside the promise.
When $reg.loading is changed to true, it is correctly updated in the template, but when is changed to false, the scope variable is updated in the controller but the template ignores it.
$reg.submit = () => {
$reg.loading = true;
firebase.auth().createUserWithEmailAndPassword($reg.user.email, $reg.user.password)
.catch(error => {
$reg.loading = false;
});
};
The template is just a form where I call $reg.submit() function when the submit button is clicked (tested with both ng-submit & ng-click).