title: Check all entries from current page Angular
body: <p>If I click the <code>Select all</code> checkbox, all entries will be selected. But if I have a list of users containing 50 users and I paginate them 5 per page, if I press the checkbox, they will be all selected, not just the entries on the selected page. How can I resolve this? This is a snippet of my code.</p>
  
  <p>.html</p>
  
  <pre><code>&lt;table class="spacing-table table-responsive"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;
          &lt;label class="customcheck"&gt;
            &lt;input type="checkbox" (change)="selectAll()"&gt;
            &lt;span class="checkmark"&gt;Select all&lt;/span&gt;
          &lt;/label&gt;
        &lt;/th&gt;
        &lt;th id="table-header"&gt;Name&lt;/th&gt;
        &lt;th id="table-header"&gt;Group&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr *ngFor="let user of usersList | paginate: { itemsPerPage: 5, currentPage: p }"&gt;
          &lt;td&gt;
            &lt;label class="customcheck"&gt;
              &lt;input type="checkbox"&gt;
              &lt;span class="checkmark"&gt;Select all&lt;/span&gt;
            &lt;/label&gt;
          &lt;/td&gt;
          &lt;td&gt;{{user.name}}&lt;/td&gt;
          &lt;td&gt;{{user.group}}&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;pagination-controls (pageChange)="p=$event" previousLabel="Previous" nextLabel="Next"&gt;&lt;/pagination-controls&gt;
  </code></pre>
  
  <p>.ts</p>
  
  <pre><code>isSelected: boolean = false
  selectAll() {
      this.isSelected = !this.isSelected
  }
  </code></pre>
  
  <p>Thank you for your time!</p>