2

I will keep it short , i want to add ngModel to dynamically added new input rows (I have Mat table with multiple rows with add element method which adds new row everytime on click of button) so that i can bind the user entered values and send to Backend,

Please see StackBlitz

Prashant Pimpale
  • 10,349
  • 9
  • 44
  • 84
Umesh C
  • 25
  • 2
  • 10

1 Answers1

1

To get the array of all values you can use:

this.myformArray.value

To get the array of particular key like name then you can use map operator:

this.myformArray.value.map(x => x.name); // will return ["n1","n2","n3"]
Prashant Pimpale
  • 10,349
  • 9
  • 44
  • 84