import { ObUnsavedChangesService } from './unsaved-changes.service' ; import { Injectable } from '@angular/core' ; import { CanDeactivate } from '@angular/router' ; @ Injectable ( { providedIn : 'root' } ) export class ObUnsavedChangesGuard implements CanDeactivate < any > { constructor ( private readonly unsavedChangesService ) { } canDeactivate ( ) { return this . unsavedChangesService . canDeactivate ( ) ; } }