title: How to use search pipe with pagination in ngFor using angular 4
body: <p>I have the below code for search pipe </p>
  
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  
  @Pipe({
    name: 'pkhospitalparam'
  })
  export class PkhospitalparamPipe implements PipeTransform {
  
    transform(value: any[], searchString: string ) {
  
      if (!searchString) {
        console.log('no search');
        return value;
      }
  
      return value.filter(it =&gt; {
          const hospitalName = it.name.toLowerCase().includes(searchString.toLowerCase());
  
          return (hospitalName);
      });
   }
  
  }
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code> &lt;input type="text" class="form-control" [(ngModel)]="searchHospitalParam"  /&gt;
  
               &lt;div *ngFor="let result of resultArray | paginate: { itemsPerPage: 5, currentPage: p } | pkhospitalparam:searchHospitalParam"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I have passed the pipe param in ngFor and it works fine. The problem is since I have pagination ( around 50 pages) implemented, the search doesnt happen for 50 pages altogether. Search filters only on the page where I am . Is there anyway to do a global search for all pages?</p>