Angular routing outside component code

Date: 2019-01-16
export class AngularRoutingPlug implements INavigateTo {
    private readonly router: Router;
    private readonly ngZone: NgZone;

    constructor(router: Router, ngZone: NgZone) {
        this.router = router;
        this.ngZone = ngZone;
    }

    public go(url: string, params: NavigationExtras) {
        this.ngZone.runTask(() => this.router.navigate([url], params));
    }
}
17900cookie-checkAngular routing outside component code