@nrwl/angular:component
Creates a new, generic Angular component definition in the given or default project.
Usage
nx generate component ...nx g c ... #sameBy default, Nx will search for component in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
nx g @nrwl/angular:component ...Show what will be generated without writing to disk:
nx g component ... --dry-runOptions
changeDetection
DefaultDefault, OnPushThe change detection strategy to use in the new component.
displayBlock
falseSpecifies if the style will contain :host { display: block; }.
export
falseSpecifies if the component should be exported in the declaring NgModule. Additionally, if the project is a library, the component will be exported from the project's entry point (normally index.ts).
flat
falseCreate the new files at the top level of the current project.
inlineStyle
falseInclude styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.
inlineTemplate
falseInclude template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.
module
The filename or path to the NgModule that will declare this component.
name
The name of the component.
path
pathThe path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.
project
The name of the project.
style
csscss, scss, sass, less, noneThe file extension or preprocessor to use for style files, or none to skip generating the style file.
skipTests
falseDo not create spec.ts test files for the new component.
skipImport
falseDo not import this component into the owning NgModule.
selector
html-selectorThe HTML selector to use for this component.
skipSelector
falseSpecifies if the component should have a selector or not.
type
componentAdds a developer-defined type to the filename, in the format name.type.ts.
viewEncapsulation
Emulated, None, ShadowDomThe view encapsulation strategy to use in the new component.