Angular CanActivateChild Guard

    0

    0

    lucycodes42

    Angular snippets for TypeScript

    Library: angular

    Shortcut: a_guard_can_activate_child

    import { Injectable } from '@angular/core';
    import { ActivatedRouteSnapshot, CanActivateChild, RouterStateSnapshot } from '@angular/router';
    
    @Injectable({providedIn: 'root'})
    export class NameGuard implements CanActivateChild {
      constructor() { }
    
      canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
        return true;
      }
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.