title: primeNg Checkbox binding object in Datatable
body: <p><a href="https://www.primefaces.org/primeng/#/checkbox" rel="nofollow noreferrer">https://www.primefaces.org/primeng/#/checkbox</a></p>
  
  <p>In the below code I am trying to get the checkboxes to add objects to an array that is in model driven form with the variable name of selectedComponents.</p>
  
  <p>So the object type of item1 below is  CampaignProductModel and that is an array called selectedComponents in my model for the form. </p>
  
  <p>I am having trouble binding and added of all checked items to the array in my model object. </p>
  
  <pre><code> &lt;p-dataTable *ngIf="perviousCampaignProduct" [value]="perviousCampaignProduct" #dt [responsive]="true" filter="filter" [rows]="25" [paginator]="true" selectionMode="single" [(selection)]="selectedItem" [contextMenu]="cm"&gt;
      &lt;p-header&gt;Pervious Campaign Products &lt;/p-header&gt;
      &lt;p-column header="Images"&gt;
          &lt;template let-item="rowData" pTemplate="body"&gt;
            &lt;img style="max-height:150px;" src="http://cdnll.somesite.com/images/1000/{{item.itemSku}}.jpg" /&gt;
          &lt;/template&gt;
      &lt;/p-column&gt;
      &lt;p-column field="itemSku" header="Item" [filter]="true" filterMatchMode="contains" filterPlaceholder="Search"&gt;&lt;/p-column&gt;
      &lt;p-column field="components" header="Components"&gt;
         &lt;template let-item="rowData" let-col pTemplate="body"&gt;
            &lt;ul style="list-style: none;"&gt;
               &lt;li *ngFor="let item1 of item[col.field]"&gt;
                  &lt;p-checkbox value="item1" formControlName="selectedComponents" label="{{item1.itemSku}}"&gt;&lt;/p-checkbox&gt;
               &lt;/li&gt;
            &lt;/ul&gt;
         &lt;/template&gt;
       &lt;/p-column&gt;
    &lt;/p-dataTable&gt; 
  </code></pre>
  
  <p><strong>Goal</strong></p>
  
  <p>Added all check items from p-checkbox as objects to an array in my model driven form.</p>
  
  <p>Tried:</p>
  
  <pre><code>value="{{item1}}"
  </code></pre>
  
  <p>... knew it won't work</p>