Created
June 16, 2019 06:38
-
-
Save NetanelBasal/10bef6f0aed5610abe2e8dcc698a0700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class AppComponent { | |
group = new FormGroup({ | |
email: new FormControl(), | |
password: new FormControl(), | |
captcha: new FormControl(), | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form [formGroup]="group" #form="ngForm"> | |
<input type="email" formControlName="email"> | |
<input type="password" formControlName="password"> | |
<app-captcha formControlName="captcha"></app-captcha> | |
<div *ngIf="group.get('captcha').hasError('invalid') && form.submitted"> | |
Wrong answer... | |
</div> | |
<button type="sumbit">Sumbit</button> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment