Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form [formGroup]="addAttributeForm" fxLayout="column">
- <mat-form-field>
- <input matInput formControlName="title" placeholder="Title" required>
- <mat-error>This field is required</mat-error>
- </mat-form-field>
- </form>
- onSubmit(form: FormGroup) {
- // do work
- form.reset();
- }
- showForm = true;
- formGroup: FormGroup = this.formBuilder.group({
- username: ['', Validators.required],
- password: ['', Validators.required]
- });
- reset(): void {
- this.showForm = false;
- setTimeout(() => this.showForm = true);
- }
Add Comment
Please, Sign In to add comment