Created
July 29, 2018 10:45
-
-
Save Tanver-Hasan/dbce0f4518fe5e789ae7a90fd5943480 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<mat-card> | |
<mat-card-content> | |
<form class="example-form" [formGroup]="customerForm"> | |
<mat-form-field class="example-full-width"> | |
<input type="text" matInput formControlName="firstName" placeholder="FirstName"> | |
</mat-form-field> | |
<mat-form-field class="example-full-width"> | |
<input type="text" matInput formControlName="lastName" placeholder="Last Name"> | |
</mat-form-field> | |
<mat-card> | |
<button type="submit" mat-raised-button color="primary" (click)="addMobile()"> | |
Add More Number </button> | |
<br> | |
<br> | |
<div formArrayName="mobiles" *ngFor="let leg of mobiles.controls; let i= index;"> | |
<div [formGroupName]="i"> | |
<mat-form-field class="example-full-width"> | |
<input type="number" matInput placeholder="Mobile Number" formControlName="number"> | |
</mat-form-field> | |
<button type="button" mat-raised-button color="accent" (click)="removeMobile(i)"> Remove</button> | |
</div> | |
</div> | |
</mat-card> | |
<button type="button" mat-raised-button color="primary" (click)="save()" [disabled]="!customerForm.valid"> | |
Save</button> | |
</form> | |
</mat-card-content> | |
</mat-card> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment