Skip to content

Instantly share code, notes, and snippets.

@bariscanyilmaz
Created May 12, 2019 16:47
Show Gist options
  • Save bariscanyilmaz/20bc13459de666990bfa1af4f8c9e0db to your computer and use it in GitHub Desktop.
Save bariscanyilmaz/20bc13459de666990bfa1af4f8c9e0db to your computer and use it in GitHub Desktop.
<div class="book-form-categories" formArrayName="bookCategories"
*ngFor="let item of addBookForm.get('bookCategories')['controls']; let i = index;">
<mat-form-field [formGroupName]="i" class="book-form-category">
<mat-label>Book Category</mat-label>
<mat-select formControlName="bookCategory" required>
<mat-option *ngFor="let category of data" [value]="category.Name">
{{category.Name}}
</mat-option>
</mat-select>
</mat-form-field>
<button *ngIf="i!=0" mat-button (click)="removeCategoryControl(i)">
<mat-icon>delete</mat-icon>
</button>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment