import {Injectable} from '@angular/core'; import {ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot} from '@angular/router'; import {ActivePathwayGuard} from './active-pathway.guard'; @Injectable({ providedIn: 'root' }) export class NoActivePathwayGuard implements CanActivate { constructor(private activePathwayGuard: ActivePathwayGuard) { } canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean { return !this.activePathwayGuard.hasActivePathway(); } }