title: Cannot read property 'value' of undefined in Angular2 Typescript
body: <p>I am building an Angular2 app and trying to get rid of a div on click through <code>*ngIf</code></p>
  
  <p>Here's my view:</p>
  
  <pre><code>&lt;router-outlet&gt;
  
  &lt;div class="releasesMenu" *ngIf="detailedInfo"&gt;
    &lt;h1&gt;Releases&lt;/h1&gt;
    &lt;div class="search"&gt;
      &lt;input type="text" #search (keyup)="0" placeholder="Find release by its name, song or year"&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="releasesOutlet container"&gt;
          &lt;div class="row releasesBlock"&gt;
             &lt;div *ngFor="let release of (releases| searchFilter: search.value )" class="releaseRender" (click)="onSelect(release)"&gt;
                &lt;div class="releaseRenderWrap" *ngIf="!selectedRelease"&gt;
              &lt;span&gt;Something interesting...&lt;/span&gt;
            &lt;/div&gt;
         &lt;/div&gt;
  
          &lt;div class="releaseDetails" *ngIf="selectedRelease"&gt;
            &lt;div class="releaseDetailsWrap"&gt;
                  &lt;span&gt;Some details...&lt;/span&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
  &lt;/router-outlet&gt;
  </code></pre>
  
  <p>Here's my controller:</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { SearchFilter } from './../search-filter.pipe';
  import { ReleasesService } from '../releases/releases.service';
  
  @Component({
    selector: 'releases-component',
    providers: [ReleasesService],
    templateUrl: './app/releases/releases.component.html',
    styleUrls: ['./app/releases/releases.component.css','./css/grid.css']
  })
  
  export class ReleasesComponent implements OnInit { 
    releases: any = [];
    release: any;
    selectedRelease: any;
    private detailedInfo: boolean;
  
    onSelect(release){
      this.detailedInfo = false;
      this.selectedRelease = release;
      console.log(release)
      }
  
    constructor(private releasesService: ReleasesService){ }
  
    ngOnInit(){
      this.releasesService.getReleases()
      .subscribe(data =&gt; this.releases = data);
    }
  
  }
  </code></pre>
  
  <p>What I want is to remove / hide my <code>.releasesMenu</code> block on <code>(click)="onSelect(release)</code>. But I am getting the error:
  <strong>Cannot read property 'value' of undefined</strong></p>