In our SCRUM application we have a User Edit Form. On that form we require users to provide a password. Since the password field is obscured and the user cannot see what they are typing, it is helpful to have a
confirm password field.
We need to check that the password and confirm password field are identical. We will create a custom validation directive that we can apply to an input element that checks whether the model of the input element matches another model value. In use, it will look like this:
<form name="passwordForm"> <input type="password" name="password" ng-model="user.password"> <input type="password" name="confirmPassword" ng-model="confirmPassword" validate-equals="user.password"> </form>