For the following code:
userType: <input name="input" ng-model="userType" required>
...
myForm.input.$valid = {{myForm.input.$valid}}
myForm.input.$error = {{myForm.input.$error}}
Both $valid and $error will be false if the user touched the input and left it empty.
My question is:
- How does angularjs define
$validand$error? For example,$touchedhas two states (touched or untouched). but what does it mean by "valid" or "invalid"? - Can I customize or redefine them?