@nx/angular:directive
Creates a new, generic directive definition in the given project.
Creates a new, generic directive definition in the given project.
nx generate directive ...
nx g d ... #same
By default, Nx will search for directive
in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
nx g @nx/angular:directive ...
Show what will be generated without writing to disk:
nx g directive ... --dry-run
The name of the new directive.
The name of the project.
false
The declaring NgModule exports this directive.
true
When true (the default), creates the new files at the top level of the current project.
The filename of the declaring NgModule.
path
The path at which to create the interface that defines the directive, relative to the workspace root.
A prefix to apply to generated selectors.
false
Do not create "spec.ts" test files for the new class.
false
Do not import this directive into the owning NgModule.
html-selector
The HTML selector to use for this directive.
false
Whether the generated directive is standalone. Note: This is only supported in Angular versions >= 14.1.0.
false
Skip formatting of files.