Skip to content

Instantly share code, notes, and snippets.

@zenius
Created June 19, 2019 06:14
Show Gist options
  • Save zenius/1e5b73c833ecdcc4ec783275633819a1 to your computer and use it in GitHub Desktop.
Save zenius/1e5b73c833ecdcc4ec783275633819a1 to your computer and use it in GitHub Desktop.
<form name="myForm">
<label>
User name:
<input type="text" name="userName" ng-model="user.name" required>
</label>
<span class="error" ng-show="myForm.userName.$error.required"> Required!</span>
<label>
Last name:
<input type="text" name="lastName" ng-model="user.last" ng-minlength="3" ng-maxlength="10">
</label>
<span class="error" ng-show="myForm.lastName.$error.minlength">Too short!</span>
<span class="error" ng-show="myForm.lastName.$error.maxlength">Too long!</span>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment