Angular 2 Activatedroute params not working in Service or outside <router-outlet>
<p>I have a very strange problem:
index.html</p>

<pre><code>&lt;navigation-menu *ngIf="isLoggedIn"&gt;&lt;/navigation-menu&gt;
&lt;div class="content-wrapper" [ngClass]="{'fullContent' : !isLoggedIn}"&gt;
    &lt;section class="content"&gt;
        &lt;router-outlet&gt;&lt;/router-outlet&gt;            
    &lt;/section&gt;
&lt;/div&gt;
</code></pre>

<p>The navigation-menu is a component for the nav menu.
In router-outlet content there is a component called "assets". </p>

<p>What I did in asset component:</p>

<pre><code>import { ActivatedRoute}from "@angular/router";
constructor(private route: ActivatedRoute){}
public ngOnInit(): void {
    this.route.params.subscribe(params =&gt; {
        const id = params["id"];
}
</code></pre>

<p>This works and I get the parameters of my route (which is kind of "asset/:id).</p>

<p>Now I tried the same in my Navigation-Menu Component (which is "outside" the router outlet) and in a global service called contextservice.
Same code as above, but it is not even triggered on route change. If I try to get a current router snapshot </p>

<pre><code>  const strId = this.route.snapshot.params["id"];
</code></pre>

<p>after NavigationEnd event was triggered it is the same result: strId is undefined because params are an empty object.</p>

<p>It only works in my asset component.
Is this working as intended or how should this be handled? </p>

<p>My intension was to trigger an event from a global service (or a "global" component like the nav menu) which is listening to all route(-params) changes. </p>

<p>My only solution would be to parse the complete url after every NavigationEnd event which in my opinion is no proper way...Or to handle the params change in each child component (in router-outlet) itself.</p>

<p>Maybe I have just a basic error in understanding...</p>

<p>Thanks</p>

<p>Solution from accepted answer:</p>

<pre><code>this.router.events.subscribe(val =&gt; {
        if (val instanceof RoutesRecognized) {
            var strId = val.state.root.firstChild.params["id"];
        }});
</code></pre>

<p>Don't forget to import RoutesRecognized from angular router!!</p>