title: Angular 4 ngFor pipe not re filter after add an element
body: <p>I need to use data and sort them by price first the pipe works fine but when I add new element it add it in the last line and not sort them again</p>
  
  <pre><code>&lt;tr *ngFor="let game of gameslist | orderBy: 'amount'" (click)="GameClick(game.id)"&gt;...&lt;/tr&gt;
  </code></pre>
  
  <p>my pipe </p>
  
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  @Pipe({
    name: 'orderBy'
  })
  export class OrderByPipe implements PipeTransform {
  
    transform(array: Array&lt;string&gt;, args: string): Array&lt;string&gt; {
      array.sort((a: any, b: any) =&gt; {
        if ( a[args] &gt; b[args] ) {
          return -1;
        }else if ( a[args] &lt; b[args] ) {
          return 1;
        }else {
          return 0;
        }
      });
      return array;
    }
  }
  </code></pre>
  
  <p><strong>Before add</strong>
  <a href="https://i.stack.imgur.com/6ZA8j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6ZA8j.png" alt="before add"></a></p>
  
  <p><strong>after add</strong>
  <a href="https://i.stack.imgur.com/mjKQL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mjKQL.png" alt="after add"></a></p>