notEqualTo
The value must not be exactly equal to the given string (strict equality).
Signature
NguardValidators.String.notEqualTo(value: string): ValidatorFn
| Parameter | Type | Description |
|---|---|---|
value | string | The value the field must not equal |
Reactive forms
import { FormControl } from '@angular/forms';
import { NguardValidators } from 'ng-nguard';
new FormControl('', [NguardValidators.String.notEqualTo('default')]);
Template-driven forms
<input ngModel name="name" [nguardStringNotEqualTo]="'default'" />
Error key
{ notEqualTo: true }
Notes
- Uses strict inequality (
!==).
See also
equalTo— opposite intent