title: Angular 2. Observable is not defined
body: <p>I'm trying to use <code>Observable</code> and <code>ChangeDetectionStrategy</code> in order to inform the others components about changes happend. Unfortunately Observable object <code>addItemStream</code> is undefined. What is wrong here?</p>
  
  <pre><code>import { Component, ChangeDetectionStrategy, ChangeDetectorRef, Input }          from '@angular/core'
  import { ROUTER_DIRECTIVES, Router }  from '@angular/router';
  import {Observable} from 'rxjs/Observable';
  
  @Component({
      selector: 'bp-header',
      templateUrl: 'app/header.component.html',
      directives: [ROUTER_DIRECTIVES],
      changeDetection: ChangeDetectionStrategy.OnPush
  })
  export class HeaderComponent {
      @Input() addItemStream: Observable&lt;any&gt;;
      public isActive: number;
      public language: string = "en";
      constructor(private cd: ChangeDetectorRef) {}
      ngOnInit() {
          this.isActive = 1;
       }
      ngAfterViewInit() {
      this.addItemStream.subscribe(() =&gt; {
          this.setLanguage; // application state changed
          this.cd.markForCheck();
         })
      }
      public setLanguage = (language: string) =&gt; {
          if (this.language === language) { return }
          else { this.language = language };
      }
      public setActive(active: number) {
          if (this.isActive === active) return;
          this.isActive = active;
      }
  }
  </code></pre>