title: angular 2 Observable complete not called
body: <p>I am playing around with hero app fro angular 2 tutorial and right now i have this Component</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core'
  import { Subject } from 'rxjs/Subject';
  import { Hero } from "./hero";
  import { Router } from "@angular/router";
  import { HeroService } from "./hero.service";
  import { BehaviorSubject } from "rxjs/BehaviorSubject";
  
  
  @Component({
      selector: 'hero-search',
      templateUrl: 'app/hero-search.component.html',
      styleUrls: ['app/hero-search.component.css'],
  })
  export class HeroSearchComponent implements OnInit{
      heroes: Hero[];
      isLoading: BehaviorSubject&lt;boolean&gt; = new BehaviorSubject(false);
      error: any;
      private searchNameStream = new Subject&lt;string&gt;();
  
      constructor(
          private heroService: HeroService,
          private router: Router
      ) {}
  
      ngOnInit() {
          this.searchNameStream
              .debounceTime(400)
              .distinctUntilChanged()
              .switchMap(name =&gt; {
                  this.isLoading.next(true);
                  return this.heroService.getHeroesByName(name)
              })
              .subscribe(
                  heroes =&gt; this.heroes = heroes,
                  error =&gt; this.error = error,
                  () =&gt; {
                      console.log('completed');
                      this.isLoading.next(false);
                  })
      }
  
      // Push a search term into the observable stream.
      search(Name: string): void {
          this.searchNameStream.next(Name)
      }
  
      gotoDetail(hero: Hero): void {
          let link = ['/detail', hero.id];
          this.router.navigate(link);
      }
  
  }
  </code></pre>
  
  <p>The problem is that, if i understand it correctly, subscribe takes three callback parameters <code>.subscribe(success, failure, complete);</code>. But in my case the complete part is never executed. I guess it has something to do with how switchMap works. Am i right?</p>