component
ng generate component <name> [options]
ng g component <name> [options]
Creates a new generic component definition in the given or default project.
Refer:https://angular.io/cli/generate
OR
In command prompt type
ng generate component YOURCOMPONENTNAME
There are even shorthands for this: the commands generate
can be used as g
and component
as c
:
ng g c YOURCOMPONENTNAME
you can use ng --help
, ng g --help
or ng g c --help
for the docs.
Refer: https://stackoverflow.com/questions/44151427/how-to-create-a-new-component-in-angular-4-using-cli