title: How can I set i=index of array before I filter it in Angular 2?
body: <p>I am currently having trouble when paginating a list of clients in Angular 2. Here is a snippet of my code:</p>
  
  <pre><code>&lt;tr *ngFor="let client of eClients | filter:term | paginate: { itemsPerPage: 20, currentPage: p}; let i = index" (click)="toggleClient(i)"&gt;
     &lt;td&gt;
      &lt;checkbox [(ngModel)]="eClients[i].selected"&gt;
       {{client.name}}
      &lt;checkbox&gt;
     &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>The problem is the index is not corresponding to the actual position in the array. For example, if I go to page 2 and click on client #2 in the list I should get an index of 22, however I am getting 2. It seems that the index only spans from 0-19 as I move from page to page. It is filtering the data first and then setting an index. How can I set "i=index" before any of the filters or pagination take place?</p>
  
  <p>P.s. "checkbox" is my own module and "term" is my own pipe filter.</p>
  
  <p>Please help. Thank You</p>