Skip to content

Instantly share code, notes, and snippets.

@dejanvasic85
Last active August 29, 2015 14:14
Show Gist options
  • Save dejanvasic85/3c6391fdca6e45d2fcc4 to your computer and use it in GitHub Desktop.
Save dejanvasic85/3c6391fdca6e45d2fcc4 to your computer and use it in GitHub Desktop.
Angular Password Strength Indicator
<div ng-app="passwordModule" ng-controller="credentialsController" class="container">
<form name="form">
<div class="form-group">
<label for="password">Password</label>
<input type="text" name="password" id="password" ng-model="credentials.password" ng-model-options="{allowInvalid: true}" pattern-validator="((?=.*\d)(?=.*[A-Z])(?=.*\W).{8,8})" class="form-control" />
</div>
<div class="form-group">
<label>Password Strength</label>
<password-strength ng-model="credentials.password"></password-strength>
</div>
<div class="alert alert-error" ng-show="form.password.$error.passwordPattern">The password does not meet requirements!</div>
</form>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment