title: Navigate multiple times to the same anchor Angular2
body: <p>I have a pretty simple Angular 2 app and I'm trying to navigate to the hrefs of the page. I looked at different questions like <a href="https://stackoverflow.com/questions/39702568/angular2-navigate-to-anchor-on-another-page">Angular2 navigate to anchor on another page</a> or github issues like this one   <a href="https://github.com/angular/angular/issues/6595" rel="nofollow noreferrer">https://github.com/angular/angular/issues/6595</a> and I ended up having a working solution which is having this piece of code in my component:</p>
  
  <pre><code>constructor(router: Router){
          router.events.subscribe(s =&gt; {
              if (s instanceof NavigationEnd) {
                  const tree = router.parseUrl(router.url);
                  if (tree.fragment) {
                  const element = document.querySelector("#" + tree.fragment);
                  if (element) { element.scrollIntoView(element); }
                  }
              }
          });
      }
  </code></pre>
  
  <p>that works absolutely fine however if I want to go again to the same href it doesn't work and the page doesn't navigate to the anchor. My question is whether the subscribe needs to be placed somewhere else or whether I need to tell my component not to unsubscribe (guess that's what's happening?)?</p>