Skip to content

Instantly share code, notes, and snippets.

@sulco
Last active September 3, 2015 07:23
Show Gist options
  • Save sulco/af0c6890375cd4c50923 to your computer and use it in GitHub Desktop.
Save sulco/af0c6890375cd4c50923 to your computer and use it in GitHub Desktop.
<form name="registration">
<div class="form-group">
<label for="username">Username</label>
<input type="text" class="form-control" required ng-minlength="3"
id="username" name="username" ng-model="user.username"/>
<ng-messages for="registration.username.$error"
ng-show="registration.username.$dirty && registration.username.$invalid" role="alert">
<ng-message when="required">Username is required</ng-message>
<ng-message when="minlength">Username must be at least 3 characters long</ng-message>
</ng-messages>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment