Guest User

Untitled

a guest
Nov 8th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <form [formGroup]="addAttributeForm" fxLayout="column">
  2. <mat-form-field>
  3. <input matInput formControlName="title" placeholder="Title" required>
  4. <mat-error>This field is required</mat-error>
  5. </mat-form-field>
  6. </form>
  7.  
  8. onSubmit(form: FormGroup) {
  9. // do work
  10. form.reset();
  11. }
  12.  
  13. showForm = true;
  14. formGroup: FormGroup = this.formBuilder.group({
  15. username: ['', Validators.required],
  16. password: ['', Validators.required]
  17. });
  18.  
  19. reset(): void {
  20. this.showForm = false;
  21. setTimeout(() => this.showForm = true);
  22. }
Add Comment
Please, Sign In to add comment