0

I am having some trouble with creating a Multi Dynamic input fields on A Reactive Angular 5 Form.

I was using this answer but I needed to expand on it for my scenario

Here is a working Example of the App

Stackblitz New Window

Stackblitz CODE

Code Excerpt

<div class="form-group">
   <label for="item_quantity"> Quantity </label>
   <input type="number" min="1" (ngModelChange)="onChanges($event)" formControlName="item_quantity" class="form-control" id="item_quantity">
</div>

<div class="form-group" style=" border: 1px solid red; padding: 10px;">
    Repeat these input based on the item_quantity from above <br>
    <input type="text" name="item_details" formControlName="item_details.item_detail" class="form-control">
</div>

Question 1

I need to repeat the item_details input based on the item_quantity for every row that the user Creates

Question 2

Can I be able to allow file uploads like this

<div class="form-group">
   <label for="item_image"> Item Image </label>
   <input type="file" formControlName="item_image" class="form-control" id="item_image">
</div>
Anele
  • 162
  • 1
  • 3
  • 21

0 Answers0