title: Why do they loop on route parameters in this Angular tutorial?
body: <p>I was looking through the <a href="https://angular.io/docs/ts/latest/tutorial/toh-pt5.html" rel="nofollow">Angular 2 tutorial about routing</a>. At some point they add a route <code>/detail/:id</code> and add an <code>ngOnInit()</code> method to handle this route and, in particular, to get the <code>:id</code> parameter:</p>
  
  <pre><code>ngOnInit(): void {
    this.route.params.forEach((params: Params) =&gt; {
      let id = +params['id'];
      this.heroService.getHero(id)
        .then(hero =&gt; this.hero = hero);
    });
  }
  </code></pre>
  
  <p>The part I don't understand is why are they looping on route parameters? Since there can be only one ID, isn't it possible to get it using <code>this.route.params['id']</code>?</p>
  
  <p>Also, if really there was multiple ids, what would the point of looping on them since each new hero would only replace the previous one?</p>