generate directive
Command
ng generate directiveng generate dCreates a new, generic directive definition in the given project.
Arguments
nameThe name of the new directive.
Value Type
stringOptions
exportThe declaring NgModule exports this directive.
Value Type
booleanDefaultfalseflatWhen true (the default), creates the new files at the top level of the current project.
Value Type
booleanDefaulttruemoduleAlias
m The declaring NgModule.
Value Type
stringprefixAlias
p A prefix to apply to generated selectors.
Value Type
stringprojectThe name of the project.
Value Type
stringselectorThe HTML selector to use for this directive.
Value Type
stringskip-importDo not import this directive into the owning NgModule.
Value Type
booleanDefaultfalseskip-testsDo not create "spec.ts" test files for the new class.
Value Type
booleanDefaultfalsestandaloneWhether the generated directive is standalone.
Value Type
booleanDefaulttrueJump to details