Static
allStatic
allStatic
anyStatic
anyStatic
blacklistStatic
creditStatic
equalStatic
ifStatic
inStatic
numericStatic
stateStatic
stateStatic
streetThe control is considered valid as long as it matches our criteria for an Address.
// All Valid
const form = new FormGroup({
streetAddress1: new FormControl('123 Main St', Validators.streetAddress),
streetAddress2: new FormControl('456 Elm Street Apt 5', Validators.streetAddress),
streetAddress3: new FormControl('789-B Oak Rd', Validators.streetAddress),
streetAddress4: new FormControl('101 First Ave, Unit #4', Validators.streetAddress),
});
// Invalid
form.get('streetAddress1').setValue('Apartment ##123');
Static
zipThe control is considered a valid zip code if it is in the 5 digit or 5 plus 4 digit syntax. Therefore, if you prefer one over the other, you should pair this control with a length check.
An extension of the default Angular Validators provided by the Angular team.
This also includes some helper validators which may be useful for more complex validations. Such as validation based on another control.
You can add your own Validators to this by simply extending this class.
Example