generate component
ng generate componentng generate cCreates a new, generic component definition in the given project.
Arguments
nameThe name of the component.
stringOptions
change-detectionc The change detection strategy to use in the new component.
stringDefaultDefaultdisplay-blockb Specifies if the style will contain :host { display: block; }.
booleanDefaultfalseexportThe declaring NgModule exports this component.
booleanDefaultfalseflatCreate the new files at the top level of the current project.
booleanDefaultfalseinline-styles Include 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.
booleanDefaultfalseinline-templatet Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.
booleanDefaultfalsemodulem The declaring NgModule.
stringprefixp The prefix to apply to the generated component selector.
stringprojectThe name of the project.
stringselectorThe HTML selector to use for this component.
stringskip-importDo not import this component into the owning NgModule.
booleanDefaultfalseskip-selectorSpecifies if the component should have a selector or not.
booleanDefaultfalseskip-testsDo not create "spec.ts" test files for the new component.
booleanDefaultfalsestandaloneWhether the generated component is standalone.
booleanDefaulttruestyleThe file extension or preprocessor to use for style files, or 'none' to skip generating the style file.
stringDefaultcsstypeAdds a developer-defined type to the filename, in the format "name.type.ts".
stringDefaultComponentview-encapsulationv The view encapsulation strategy to use in the new component.
string