Custom Validations in Angular Forms
We often are going to want to write our own custom validations. To see how validators are implemented, let’s look at Validators.required from the Angular core source: export class Validators { static required(c: FormControl): StringMap<string, boolean> { return isBlank(c.value) || c.value == “” ? {“required”: true} : null; } A validator: – Takes a FormControl as its …