This is a small Angular directive that supports form input validation for equal values, e.g. for password and comparePassword fields. It's automatically updated when either the source or destination value is changed.
Install via npm
npm install angular-compare-validator --save
import { CompareValidatorModule } from 'angular-compare-validator';
@NgModule({
imports: [
CompareValidatorModule
]
})
export class AppModule {
}
<input type="password" name="passwordInput" [(ngModel)]="password" />
<input type="password" name="confirmPasswordInput" [compareEqual]="password" [(ngModel)]="confirmPassword" />
<span *ngIf="confirmPasswordInput.errors && confirmPasswordInput.errors.compareEqual">
Passwords do not match
</span>
Run prepublish.ps1
to generate build output in the ./dist
folder.
To run tests, execute the test.ps1
script. JUnit test results are then found in karma-results.xml
while coverage is available in the Cobertura format at coverage/PhantomJS/typescript.coverageresult
.