title: Angular how to get the multiple checkbox values?
body: <p>I m using a checkbox in Angular to select more than one element and I'm trying to get the value of that checkbox for submitting.</p>
  <p>Instead I'm getting the value those values as an array of <code>true</code>-s.
  That's what I've tried:</p>
  <pre class="lang-js prettyprint-override"><code>export class CreateSessionComponent implements OnInit {
    form : FormGroup ;
  
    constructor(private formBuilder: FormBuilder) {}
  
    ngOnInit() {
      this.form = this.formBuilder.group({
        userdata :  new FormArray([
          new FormControl('', Validators.required)
        ])
      })
    }
  }
  </code></pre>
  <p><code>userdata</code> is a dynamic array populated from a database.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div formArrayName=&quot;useremail; let k = index&quot;&gt;
    &lt;div *ngFor=&quot;let data of userdata&quot;&gt;
      &lt;div&gt;
        &lt;input type=&quot;checkbox&quot; name=&quot;useremail&quot; formControlName =&quot;{{k}}&quot; [value]=&quot;data.email&quot;&gt;{{data.email}}
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt; 
  </code></pre>