title: Create dynamically FormArray fields in a form in Angular
body: <p>I am learning about FormArray to make a dynamic form. My problem is that I have to relate the fields in the formarray to a selected item in a multiple selection dropdown. Let's say I select an option called 'Foo', then 3 fields to give information about Foo will be created, and more can be created, therefore FormArray.</p>
  
  <p>So, I have followed this tutotial to learn a bit about it <a href="https://alligator.io/angular/reactive-forms-formarray-dynamic-fields/" rel="nofollow noreferrer">https://alligator.io/angular/reactive-forms-formarray-dynamic-fields/</a> but my problem is that this works only if the FormArray field is defined in the form since the begining. What I am doing to relate the selected option and its fields is creating field dynamically in its form like this:</p>
  
  <pre><code>const idCategoria: string =  '1';
  this.indicadorModal.addControl('objetivo.' + idCategoria, new FormGroup(
      {
          objetivos: this.fb.array([this.crearObjetoObjetivo()])
      }
  ));
  </code></pre>
  
  <p>this will cause that indicadorModal (which is a FormGroup) will have fields like, for example, objetivo.1 , objetivo.2, etc. BUT NOW I need these to be form array but I dont seem to be able to do what in the tutorial I liked says, it says that the control doesn't exist. Is there something wrong with this?</p>
  
  <p>Thanks</p>