My webapp is built using AngularJS and Firebase for user authentication. Each user has an email in their profile, and I want to show a warning if the email is not set. However, when a user logs in and their email is set, the warning briefly flashes at the top of the page. This happens because the user object doesn't load completely in the first milliseconds, causing the warning to be displayed even when the email is already set. If I replace !(user.email) with a false variable, the warning never appears. The variable user.email
is controlled directly by Firebase.
<div ng-show="user">
<div class="row" ng-show="!(user.email)">
<div class="col-md-12">
<div class="alert alert-warning">
Warning! You must...
</div>
</div>
</div>
</div>
Is there a way to prevent the warning from showing up?