Angular 12 References/ CLI
🍀 Angular References

Guard generator

ng generate guard [name] [--[argument]=[value]]
ng generate g

Create a guard.



Flag to indicate if a dir is created.

Type boolean
Default true


Specifies which interfaces to implement.

Type string
Values CanActivate|CanActivateChild|CanLoad


Specifies whether to apply lint fixes after generating the guard.

Type boolean
Default false


The name of the project.

Type string


When true, does not create spec.ts test files for the new guard.

Type boolean
Default false