title: Angular 6 FormArray and looping in HTML
body: <p>All,</p>
  
  <p>I am having a really hard time getting FormArray working with my current application.  I am trying to get names from a service and add them to a reservation form (and give the ability to the user to add/delete/modify names)</p>
  
  <p>Here is relevant code:</p>
  
  <pre><code>reservationForm: FormGroup;
  attendeeArray: FormArray;
  
  constructor(
    private groupMeetingService: GroupMeetingsService,
    private formBuilder: FormBuilder
  ) {}
  
  ngOnInit() {
    this.initialize();
  }
  
  private createAttendeeName(name: string): FormControl {
    return this.formBuilder.control({
      name: name
    });
  }
  
  private initialize(): void {
    this.attendeeArray = this.formBuilder.array([]);
    this.reservationForm = this.formBuilder.group({
      attendeeRadio: ['inPerson'],
      attendeeName: this.attendeeArray,
    });
  
    this.groupMeetingService.getMeeting(this.meeting.id).subscribe(meeting =&gt; 
    {
      this.meetingLocation = meeting.location;
    });
    this.groupMeetingService
      .getReservations(this.meeting.id)
      .subscribe(data =&gt; {
        this.reservations = data;
        this.attendeeArray = this.getAttendeeNames();
        data.attendees.forEach(attendee =&gt; {
          this.attendeeArray.push(this.createAttendeeName(attendee.name));
        });
        console.log('array', this.reservationForm);
    });
  }
  </code></pre>
  
  <p>When I look at my console, it does show that it is being added.  Is the above code correct?</p>
  
  <p>And if it is correct, how do I loop through it in HTML and get it to display?  </p>
  
  <p>I have tried a bunch of things but no luck :-(</p>
  
  <pre><code>&lt;div class="reservation-container" [formGroup]="reservationForm"&gt;
    &lt;div formArraryName="attendeeArray" *ngFor="let attendee of reservationForm.controls['attendeeName'].controls; let i = index"&gt;
      &lt;input [formControlName]="i" value="{{ attendee.name }}"&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thx
  jonpfl</p>