generate guard
Command
ng generate guard
ng generate g
Generates a new, generic route guard definition in the given project.
Arguments
name
The name of the new route guard.
Value Type
string
Options
flat
When true (the default), creates the new files at the top level of the current project.
Value Type
boolean
Defaulttrue
functional
Specifies whether to generate a guard as a function.
Value Type
boolean
Defaulttrue
implements
Alias
guardType
Specifies which type of guard to create.
Value Type
array
project
The name of the project.
Value Type
string
skip-tests
Do not create "spec.ts" test files for the new guard.
Value Type
boolean
Defaultfalse
Jump to details