Property 'currentUrlTree' is private and only accessible within class 'Router'
<p>I am currently trying to create a login function using jwt, however I am currently getting the below error when trying to capture the current url of the active route.</p>

<p>client?26cb:76 [default] /Users/~/src/app/app.component.ts:51:75 
Property 'currentUrlTree' is private and only accessible within class 'Router'. </p>

<p>app.component.ts </p>

<pre><code>import {Component, NgZone, OnInit} from '@angular/core';
import {Router} from "@angular/router";
import {AuthService} from "./auth.service";
import {tokenNotExpired} from "angular2-jwt";

@Component({
 selector: 'app-root',
 templateUrl: './app.component.html',
 styleUrls: ['./app.component.css']
})
export class AppComponent {
 constructor (
  private _router: Router,
  private _authService: AuthService,
  private _zone: NgZone
 ) {
}
ngOnInit():void {
 this._router.navigate(['signin']);
 this._authService.getLoggedInEvent().subscribe((val) =&gt; {

  if (val) {
    // logged in
    this._zone.run(() =&gt; this._router.navigate(['stocklist']));
  } else {
    // logged out
    this._zone.run(() =&gt; this._router.navigate(['signin']));
  }
 });
} 

routeIsActive(routePath: string) {
 let currentRoute = this._router.currentUrlTree.firstChild(this._router.currentUrlTree.root);

 let segment = currentRoute == null ? '/' : currentRoute.segment;
 return  segment == routePath;
}

logout() {
 this._authService.logout();
}

loggedIn() {
 return tokenNotExpired();
}
}
</code></pre>