Angular 6 References/ CLI
References

Guard generator

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

Create a guard.

Options

--spec#

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

--flat#

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

--project#

The name of the project.
Type string

--lintFix#

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