Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created June 16, 2019 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/10bef6f0aed5610abe2e8dcc698a0700 to your computer and use it in GitHub Desktop.
Save NetanelBasal/10bef6f0aed5610abe2e8dcc698a0700 to your computer and use it in GitHub Desktop.
export class AppComponent {
group = new FormGroup({
email: new FormControl(),
password: new FormControl(),
captcha: new FormControl(),
})
}
<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