my modal and my textbox
once i click the modal
when i click the value in modal table
adding a row
selecting again value for my second row
once i select why my first row get the value too?
angular index for formarray can anyone tell whats wrong with my codes
here's the link of the code
let me know please I'm stuck of this one
CodePudding user response:
Because id:[0]
. When you create a new new row you are always pushing same id. When closing your modal ItemDialogComponent
, it should return the item selected from the modal (response). Your return response
right now is just a string, but make it return an obj. And you pass that returned obj to addRow(response)
to be added to this.Form
.
CodePudding user response:
Wrap the input in a div and add the formGroupName there instead
<div [formGroupName]="I">
<input>
</div>