title: When creating a dynamic checkbox list i can't receive data from service (observable)
body: <p>In the service I receive all the records from the firebase database with this function.:</p>
  
  <pre><code>treatmentsRef:  AngularFireList&lt;any&gt;;
  treatments$: Observable&lt;any[]&gt;;
  
  receiveTreatment(){
      this.treatmentsRef = this.db.list('/treatments');
      this.treatments$ = this.treatmentsRef.valueChanges();
  
      return this.treatments$;
  }
  </code></pre>
  
  <p>Next i call this function in my component to fill the array:</p>
  
  <pre><code>treatments= [];
  
  constructor(public dialog: MatDialog, protected CashdeskService: CashdeskService, private formBuilder: FormBuilder, public settings: SettingsService) { 
  
      this.settings.receiveTreatment().subscribe( res =&gt; this.treatments = res);
      console.log(this.treatments);
      const formControls = this.treatments.map(control =&gt; new FormControl(false));
      this.musicForm = this.formBuilder.group({
          treatments: new FormArray(formControls)
      });
  }
  </code></pre>
  
  <p>When i console.log the subscribe everything shows fine but when i try to subscribe to this.treatments nothing happen. I need this to work because all they treatments will be shown in a dynamic checkbox from which structured like this:</p>
  
  <pre><code>&lt;form [formGroup]="musicForm" (ngSubmit)="submit()"&gt;
      &lt;label formArrayName="treatments" *ngFor="let desc of musicForm.controls.treatments.controls; let i = index" style="width: 100%"&gt;
           &lt;input type="checkbox" [formControlName]="i"&gt;
           {{treatments[i].desc}}
      &lt;/label&gt;&lt;br&gt;
      &lt;button&gt;submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Is there anyone who knows the solution? or a easier way to create a dynamic list based on the values of an array.</p>