title: Why importing operator in RxJs is needed?
body: <p>While following an Angular tutorial, I found this:</p>
  
  <pre><code>import 'rxjs/add/operator/switchMap';
  
  export class HeroDetailComponent implements OnInit {
    ngOnInit(): void {
      this.route.paramMap
        .switchMap((params: ParamMap) =&gt; this.heroService.getHero(+params.get('id')))
        .subscribe(hero =&gt; this.hero = hero);
    }
  }
  </code></pre>
  
  <p>Sorry if I found this a bit strange (due to 2 reasons: I came from Java and I'm not really following latest JS technology). Isn't <code>switchMap</code> a method owned by <code>param map</code> which an <code>Observable&lt;ParamMap&gt;</code>? When I remove the import statement, the code doesn't compile.</p>
  
  <p>I use RxJava, but all methods required to manipulate an observable are already there (attached) with the Observable class itself. </p>
  
  <p>Can someone tell me, why <code>switchMap</code> import is required? Possibly, give me some reference links.</p>