1

I am trying to understand below JSON base form. I am not able to figure out from where that yellow button "Add Phone number" comes from and how it trigger event to replicate more phone list

https://hamidihamza.com/Angular6-json-schema-form/?set=ng-jsf&example=ng-jsf-flex-layout&framework=material-design&language=en

Akber Iqbal
  • 14,487
  • 12
  • 48
  • 70
fresher
  • 399
  • 4
  • 23

1 Answers1

1

What you have is a reactive form - check the stackblitz here

The whole form is a FormBuilder group which consists of:

  • FormControls for the static (non-repeatable) part of the form (firstName, lastName etc.)
  • While the phone numbers are Formbuilder Array. Everytime that the 'Add phone number' button is clicked, an element is added to our Formbuilder Array.
  • When you click save, you get the whole form in json (check console)
Akber Iqbal
  • 14,487
  • 12
  • 48
  • 70