1<form [formGroup]="form">
2 <input type="password" formControlName="password"/>
3 <p *ngIf="form.controls.password.errors?.required">required error</p>
4 <input type="password" formControlName="certainPassword"/>
5 <p *ngIf="form.controls.certainPassword.errors?.equalTo">equalTo error</p>
6</form>