I have a signup page that gets a response from the backend when the signup form is filled out and the signup button is pressed.
If the username exists within the database, the response returns false, and then from there I change a $scope variable ($scope.signedUp) to true, which should simply show this existing error message:
<div class="padding assertive" ng-show="signedUp">
<i class="icon ion-minus-circled"></i>
Woops! Looks like that user already exists, try a different username.
</div>
Here is the current scope function within the signup controller:
$scope.signup = function(){
User.signup($scope.credentials).then(function(res){
if(res === false){
console.log('res is: ', res);
$scope.signedUp = true;
console.log('$scope.signedUp ',$scope.signedUp);
}
});
};
The first time I fill the information out, and click signup, the console logs log this:
app.js:47 res is: false
app.js:49 $scope.signedUp true
However, the error does not show up, oddly however, when I click it again, it does show up, yet nothing in the console log differs, Is this a bug with ionic? I noticed a similar post here:
But it seems the poster worked around it with display none, I would not like to do this if possible, thank you.