How to Validate Password and Confirm Password in Angular 4? How to Validate Form in Angular 4? This custom validator is used for Password and Conform Password in Angular 4 which allows us to have fields that must be equal to some other field’s i.e. 1. Password field 2. Conform Password field This custom validator is very useful for password confirmation validation, validate card etc. Example 1 – import { Component, OnInit } from '@angular/core' ; import { FormBuilder, FormGroup } from '@angular/forms' ; export class AppComponent implements OnInit { userForm: FormGroup ; password = 'password' ; constructor ( private fBuilder: FormBuilder ) { this .userForm = fBuilder.group({ name: fBuilder.control ( null , Validators.required), age: fBuilder.control ( null , [Validators.required, Validators.minLength( 2 ), Validators.maxLength( 2 )]), email: f...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers