title: Angular 4: Store pipe output variable for use outside of template
body: <p>I am aware I can alias pipe output in angular 4 but this is only useful inside the template where it is aliased.</p>
  
  <p>Example</p>
  
  <pre><code>&lt;div *ngIf="race | async as raceModel"&gt;
      &lt;h2&gt;{{ raceModel.name }}&lt;/h2&gt;
      &lt;small&gt;{{ raceModel.date }}&lt;/small&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here raceModel cannot be referenced outside of the ngIf. In my case, I am ordering and filtering a collection with pipes and want to get a hold of the length of the returned collection after filtering so I can update my NgbPagination.</p>
  
  <p>My code: </p>
  
  <pre><code>&lt;tr *ngFor="let cust of customers | filterBy: searchFilters: true | orderBy: order: reverse: true: start: end as collection"&gt;
                          &lt;td&gt;{{cust.id}}&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;/tbody&gt;
                  &lt;/table&gt;
                  &lt;ngb-pagination *ngIf="customers"
                                  (pageChange)="pageChange($event)"
                                  [collectionSize]="collection.length"
                                  [(page)]="page"
                                  [(pageSize)]="pageSize"
                                  [maxSize]="5"
                                  [rotate]="true"
                                  [ellipses]="true"
                                  [boundaryLinks]="true"&gt;
                  &lt;/ngb-pagination&gt;
  </code></pre>
  
  <p>I don't want to drag the pipes into the view model if I can avoid it. Any tips on how to secure a variable from a pipe for later use in the view?</p>