title: How can a service subscribe to the ParamMap of the current route?
body: <p>I would like to create a service that subscribes to changes in Angular's paramMap. Unfortunately this doesn't seem to work.</p>
  <pre><code>export class LocationResourcesService {
  
    constructor(private activatedRoute: ActivatedRoute) {
  
      this.activatedRoute.paramMap.pipe(
        map((params: ParamMap) =&gt; params.get('account-id')),
      ).subscribe((newValue) =&gt; console.log(newValue))
    }
    // ----------
  }
  </code></pre>
  <p>Tthe subscription above only ever emits one value - when Angular first loads into the page. And that value is <code>null</code>. The same subscription does when it's placed in the constructor of a component that's active in the page. presumably because the route has loaded and the <code>ActivatedRoute</code> has been set.</p>
  <p>I would have assumed that ActivatedRoute was a singleton service and that I could therefore subscribe to changes on it. Obviously that's not the case though so how can this service subscribe to the value of <code>activatedRoute.ParamMap</code>?</p>