Reputation: 32808
I can do this:
<span ng-show="form.size.$error.integer">Problem</span>
but I have a number of different possible errors so is there a way I can hide the span if the field is valid?
Upvotes: 0
Views: 66
Reputation: 2078
You can use $valid property, such us:
<span ng-hide="form.size.$valid">Problem</span>
Upvotes: 1
Reputation: 20129
You can use the $valid
property of the form.
<span ng-show="form.size.$error.integer && ! form.size.$valid">Problem</span>
But Im not sure why you need this. If there is no error, form.size.$error.integer
should be false and it should be hidden anyways.
Upvotes: 1