import { Injectable } from "@angular/core"; import { Router } from "@angular/router"; @Injectable({ providedIn: 'root' }) export class Startup { isLoaded:boolean = false; constructor(private router:Router) {} startup(token:string) { if (token) { this.router.navigateByUrl('/dashboard') this.isLoaded = true; } } refresh(token:string){ if (token) { this.router.navigateByUrl('/products') this.isLoaded = true; } } }