title: What is .subscribe in Angular?
body: <p>I'm going through angular-tour-of-heroes app, and I encountered .subscribe method in routing. Can someone explain what's going on here?</p>
  <p>Link for the app: <a href="https://embed.plnkr.co/?show=preview" rel="noreferrer">https://embed.plnkr.co/?show=preview</a></p>
  <p>Inside hero-detail.component.ts file,</p>
  <pre><code>ngOnInit(): void {
    this.route.paramMap
      .switchMap((params: ParamMap) =&gt; this.heroService.getHero(+params.get('id')))
      .subscribe(hero =&gt; this.hero = hero);
  }
  </code></pre>