Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nivrith/b04dbe3fe30163ba625e50ed41d6ca70 to your computer and use it in GitHub Desktop.

Select an option

Save nivrith/b04dbe3fe30163ba625e50ed41d6ca70 to your computer and use it in GitHub Desktop.
<ng-container *ngIf="formArray$ | async as formArray; else loading">
<form>
<ng-container *ngFor="let formGroup of formArray.controls">
<div [formGroup]="formGroup">
<div class="form-group">
<label for="">Title</label>
<input class="form-control" type="text" formControlName="title" />
</div>
<div class="form-group">
<label for="exampleFormControlSelect2">Body</label>
<textarea
class="form-control"
formControlName="text"
placeholder="Enter Post Text"
rows="4"
></textarea>
</div>
</div>
</ng-container>
<div class="d-flex justify-content-between">
<button
(click)="onConfirm(form)"
role="none"
class="btn btn-primary"
>
Save
</button>
</div>
</form>
</ng-container>
<ng-template #loading>...loading</ng-template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment