Checks if one input matches another
npm install angular-validation-match
 



Angular Validation: Match
===================
Checks if one input matches another. Useful for confirming passwords, emails, or anything.
The match attribute should be set equal to the ng-model value of the field to match.
Demo: http://jsfiddle.net/TheSharpieOne/r6Ltru6c/
Installation
------------
bower install angular-validation-match
Then add validation.match to your angular dependencies
Note: For angular 1.2 or lower use bower install angular-validation-match#1.3
Also: npm install angular-validation-match
Usage
-----
Simple Property Example
``html`
Password:
Confirm:
Object Property Example
`html`
Password:
Confirm:
Case insensitive (caseless) Example
`html`
Password:
Confirm: match-caseless can accept a scoped variable to allow the matching to be toggle-able between case insensitive and case sensitive. Default: false
Not Match Example
Sometimes you want to ensure the values do not match, in that case you can use the not-match flag.match-caseless
This also works in combination with (if you want to not match case insensitively).`html`
Password:
Confirm: not-match can accept a scoped variable (true/false) to be toggle-able between matching and not matching. Default: false
Ignore empty Example
`html`
Password:
Confirm: match-ignore-empty can accept a scoped variable to disable validating an empty input. Default: false
Display Custom Error
If your form and field both are named, you can access the validation result to show/hide messages.
`html`
Validate Against the $viewValue shown in the input
The internal value ($modelValue) can differ from the external value ($viewValue) as appears in the input field shown to the user. If your form and field both are named, you can validate against value displayed in the field, even if the field is invalid.
`html`$viewValue
Note: s are specific to fields/elements, not models. Different fields with the same ngModel and have different $viewValues. Becuase of this, you need to use the form directive (assigning a name` to a form tag) in combination with the specific field's name attribute to specific which field/element you want to match in particular.