title: Angular Router Activation Events
body: <p>I want to listen to Angular router events but only the first time they are activated.</p>
  
  <p>So given the following scenario: <code>A &gt; B</code>.  If I were to listen to <code>ActivationEnd</code> event, both A and B would be fired (as expected). </p>
  
  <p>Now if I were to navigate to a subroute within say <code>A &gt; B &gt; C</code>, now <code>A</code> <code>B</code> and <code>C</code> <code>ActivationEnd</code> will fire again. I would only expect <code>C</code> to fire this time.</p>
  
  <p>This is how the router works under the hood with route resolvers, I want to essentially do that behavior. My code looks like this:</p>
  
  <pre><code>this.router.events.pipe(
    tap((event) =&gt; console.log(event)),
    filter(event =&gt; event instanceof ActivationEnd)
  ).subscribe((event: ActivationEnd) =&gt; { ... })
  </code></pre>