Angular 8 References/ CLI
References

Guard generator

This is the documentation for Angular 8.
You can switch to the latest version Angular 10.
ng generate guard [name] [--[argument]=[value]]
ng generate g

Create a guard.

Options

--flat#

Flag to indicate if a dir is created.
Type boolean
Default true

--lintFix#

Specifies whether to apply lint fixes after generating the guard.
Type boolean
Default false

--project#

The name of the project.
Type string

--spec#

Specifies if a spec file is generated.
Type boolean
Default true