angular-input-match

Checks if one input matches another. Useful for confirming passwords, emails, or anything.
23 people use it
Submitted by: 664714?v=3 TheSharpieOne

Build Status Code Climate Test Coverage Coverage Status Dependency Status devDependency Status

Angular Validation: Match

Checks if one input matches another. Useful for confirming passwords, emails, or anything.

The "data-match" attribute should be set equal to the ng-model value of the field to match.

Demo: http://jsfiddle.net/TheSharpieOne/pojkkokc/

Installation

bower install angular-validation-match

Then add validation.match to your angular dependencies

Usage

Simple Property Example

Object Property Example

Display Custom Error If your form and field both are named, you can access the validation result to show/hide messages.

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.

Note: $viewValues 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.

comments powered by Disqus
This page was last updated over 2 years ago.