generate guard
Command
ng generate guardng generate gGenerates a new, generic route guard definition in the given project.
Arguments
nameThe name of the new route guard.
Value Type
stringOptions
flatWhen true (the default), creates the new files at the top level of the current project.
Value Type
booleanDefaulttruefunctionalSpecifies whether to generate a guard as a function.
Value Type
booleanDefaulttrueimplementsAlias
guardType Specifies which type of guard to create.
Value Type
arrayprojectThe name of the project.
Value Type
stringskip-testsDo not create "spec.ts" test files for the new guard.
Value Type
booleanDefaultfalseJump to details