1 import { Injectable } from '@angular/core'
2 import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, RouterStateSnapshot } from '@angular/router'
3 import { MetaService } from './meta.service'
6 export class MetaGuard implements CanActivate, CanActivateChild {
8 constructor (private meta: MetaService) { }
10 canActivate (route: ActivatedRouteSnapshot): boolean {
11 const metaSettings = route.data?.meta
14 this.meta.update(metaSettings)
20 canActivateChild (route: ActivatedRouteSnapshot): boolean {
21 return this.canActivate(route)