Created
June 10, 2022 03:21
-
-
Save fireflysemantics/1f8f2fd59a5993115bf99e4e41eb5a52 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
<form (ngSubmit)="onSubmit()" [formGroup]="form"> | |
<mat-form-field class="example-form-field" appearance="fill"> | |
<mat-label>Name</mat-label> | |
<input matInput type="text" formControlName="name" /> | |
<button | |
*ngIf="form.value.name" | |
matSuffix | |
mat-icon-button | |
aria-label="Clear" | |
(click)="form.controls.name.setValue('')" | |
> | |
<mat-icon>close</mat-icon> | |
</button> | |
</mat-form-field> | |
<mat-form-field class="example-form-field" appearance="fill"> | |
<mat-label>Email</mat-label> | |
<input matInput type="text" formControlName="email" /> | |
<button | |
*ngIf="form.value.email" | |
matSuffix | |
mat-icon-button | |
aria-label="Clear" | |
(click)="form.controls.email.setValue('')" | |
> | |
<mat-icon>close</mat-icon> | |
</button> | |
</mat-form-field> | |
<mat-form-field class="example-form-field" appearance="fill"> | |
<mat-label>Phone</mat-label> | |
<input matInput type="tel" formControlName="phone" /> | |
<button | |
*ngIf="form.value.phone" | |
matSuffix | |
mat-icon-button | |
aria-label="Clear" | |
(click)="form.controls.phone.setValue('')" | |
> | |
<mat-icon>close</mat-icon> | |
</button> | |
</mat-form-field> | |
<br /> | |
<button mat-button type="submit">Submit</button> | |
<br /> | |
<button mat-button (click)="reset()" type="reset">Reset</button> | |
</form> | |
<button mat-button (click)="removePhone()">Remove Phone Field</button> | |
<p [innerHTML]="data"></p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment