Skip to content Skip to sidebar Skip to footer

Angularjs Message Binding Doesn't Show Until Second Form Submit

I'm writing my first angularjs app, and it's beginning to make sense. However, I have a sign up form that isn't getting the messages in some cases to alert users to problems. I'm u

Solution 1:

I'm assuming, the Firebase callback does not involve an angular digest cycle.

To handle this, write

if (snapshot.val()) {
    $scope.$apply(function() {
        $scope.authMsg = 'Username exists— did you forget your password?';
    });

A useful reading about the topic: http://jimhoskins.com/2012/12/17/angularjs-and-apply.html


Post a Comment for "Angularjs Message Binding Doesn't Show Until Second Form Submit"