ovh-ng-input-password
v1.2.5
Published
An input[type='password'] with multiple check and popover displaying them
Downloads
5,335
Maintainers
Keywords
Readme
Input Password
Installation
Before using it, you have to install it with bower cli :
bower install ovh-ng-input-password --save
Get the sources
$ git clone https://github.com/ovh-ux/ovh-angular-input-password.git
$ cd ovh-ng-input-password
$ npm install
$ bower install
How to use?
angular.module("yourModule", [
"inputPassword"
])
.controller("mainCtrl", function(scope) {
this.rules = [
{
id: "length",
caption: "Must contain 8 to 20 characters",
validator: function (str) {
return str && str.length > 7 && str.length < 21;
}
},
{
id: "specialChar",
caption: "Can contain following characters #{}()[]-|@=*+/!:;",
validator: /^[\w~"#'\{\}\(\\)[\]\-\|\\^@=\*\+\/!:;.,?<>%*µÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ]+$/,
immediateWarning: true
},
];
this.getStrength = function(val) {
return (val.length-8) / 12;
}
});
<input-password data-ng-model="mainCtrl.password"
name="password"
data-strength="mainCtrl.getStrength(value)"
data-rules="mainCtrl.rules">
</input-password>
Docs
You can show the generated documentation using the command below in a command prompt:
grunt ngdocs && grunt connect
Then open a browser and go to http://localhost:8000/docs/
.
Unit Tests
You can unitary test by executing in a command prompt:
grunt test
Contributing
You've developed a new cool feature ? Fixed an annoying bug ? We'd be happy to hear from you !
Have a look in CONTRIBUTING.md
Related links
- Contribute: https://github.com/ovh-ux/ovh-ng-input-password/blob/master/CONTRIBUTING.md
- Report bugs: https://github.com/ovh-ux/ovh-ng-input-password/issues
- Get latest version: https://github.com/ovh-ux/ovh-ng-input-password
License
See https://github.com/ovh-ux/ovh-ng-input-password/blob/master/LICENSE