title: Angular2/4 ngFor directive does not allow variable assignment
body: <p>In my AngularJS app I used to do the following in my HTML templates:</p>
  
  <pre><code>&lt;tr ng-repeat="user in filtered = (users | filter:searchTerm | orderBy:firstName)"&gt;
  </code></pre>
  
  <p>Then I could use the variable "filtered" in my controller so that I had access to my filtered table row items.</p>
  
  <p>Angular 2/4 does not allow this assignment so how would I be able to do this in Angular 2/4?</p>
  
  <p>UPDATE:</p>
  
  <p>Component:</p>
  
  <pre><code>export class UsersComponent implements OnInit {
    users = [];
    totalItems = 0;
    filteredUsers = [];
    filteredUser: User;
  
    constructor(private dataService: DataService) { }
  
    ngOnInit() {
      this.dataService.getUsers()
      .subscribe(
        (data: any) =&gt; {
          this.users = data.data;
        },
        msg =&gt; console.error(`Error: ${msg.status} ${msg.statusText}`)
      );
    }
  
    trackItems(index, item){
      this.totalItems = index+1;
      this.filteredUsers.push(item); // &lt;- This does not work? Should be able to push the item to my filteredUsers array?
      return item ? item.id : undefined;
    }
  }
  </code></pre>
  
  <p>template:</p>
  
  <pre><code>&lt;tr *ngFor="let user of users | filterBy: ['firstName', 'lastName', 'email']: searchTerm; trackBy: trackItems"&gt;
  </code></pre>
  
  <p>Error message:</p>
  
  <pre><code>UsersComponent.html:49 ERROR TypeError: Cannot read property 'push' of undefined
      at DefaultIterableDiffer.webpackJsonp.../../../../../src/app/pages/users/users.component.ts.UsersComponent.trackItems [as _trackByFn] (users.component.ts:108)
      at DefaultIterableDiffer.webpackJsonp.../../../core/@angular/core.es5.js.DefaultIterableDiffer.check (core.es5.js:6857)
      at DefaultIterableDiffer.webpackJsonp.../../../core/@angular/core.es5.js.DefaultIterableDiffer.diff (core.es5.js:6830)
      at NgForOf.webpackJsonp.../../../common/@angular/common.es5.js.NgForOf.ngDoCheck (common.es5.js:1669)
      at checkAndUpdateDirectiveInline (core.es5.js:10837)
      at checkAndUpdateNodeInline (core.es5.js:12330)
      at checkAndUpdateNode (core.es5.js:12269)
      at debugCheckAndUpdateNode (core.es5.js:13130)
      at debugCheckDirectivesFn (core.es5.js:13071)
      at Object.View_UsersComponent_0._co [as updateDirectives] (UsersComponent.html:58)
  
  UsersComponent.html:49 ERROR CONTEXT DebugContext_ {view: Object, nodeIndex: 97, nodeDef: Object, elDef: Object, elView: Object}
  </code></pre>