title: Angular 4 - param of Pipe
body: <p>I'm creating a button which on click it loads all items from array i default way it should splice it to (0,3). I have problem with this implementation. Is there any way to set default param e.g. = 'a' and if 'b' load all? This button should be used like <strong>show more</strong> buttons.</p>
  
  <pre><code>import { Pipe, PipeTransform } from "@angular/core";
  
  @Pipe({
    name: "reverse"
  })
  export class ReversePipe implements PipeTransform {
    transform(value: any, param: any) {
  
      if (param) {
          value.reverse();
        if (param === "a") {
          return value.reverse().slice(0, 3);
        } 
      }
    }
  }
  </code></pre>
  
  <p>component.ts</p>
  
  <pre><code>&lt;ng-container *ngIf="items &gt; 0" &gt; 
      &lt;div *ngFor="let review of product$ | async | reverse:param; let i = index" &gt;
        &lt;ngb-rating [(rate)]="review.rate" [readonly]="true"&gt;&lt;/ngb-rating&gt; {{review.rate}}
  
        &lt;p&gt;{{i+1}}.) {{ review.description.description }}&lt;/p&gt;
        &lt;br /&gt;
        &lt;ng-container *ngIf="review.user"&gt;
        &lt;p class="float-right"&gt;Dodał użytkownik: {{ review.user }}&lt;/p&gt;
      &lt;/ng-container&gt;
        &lt;hr&gt;
  
      &lt;/div&gt;
      &lt;button *ngIf="items &gt; 3" (click)="param = 'a'"&gt;Pokaż wszystkie&lt;/button&gt;
    &lt;/ng-container&gt;
  </code></pre>