Projects for CLI argument --project
:
Syntax for creating a new Angular component:
Example :npm run ng -- generate component <component-name> --project=<project-name>
Note: Replace
<component-name>
with the component name to create,<project-name>
with the project to put the component, and<module-name>
with the module name to define the component.
Example, create a new component in the gmm library:
Example :npm run ng -- generate component components/hello --project=nshmp-lib-ng-gmm
Note: The above example creates a new
hello
component in theprojects/nshmp-lib-ng/gmm/lib/components
directory and updates the module inprojects/nshmp-lib-ng/gmm/lib/modules
.
Syntax for creating a new Angular service:
Example :npm run ng -- generate service <service-name> --project=<project-name>
Note: Replace
<service-name>
with the service name to create and<project-name>
with the project to put the service
Example, create a new service in the gmm library:
Example :npm run ng -- generate service services/hello --project=nshmp-lib-ng-gmm
Note: The above example creates a new
hello
service in theprojects/nshmp-lib-ng/gmm/lib/services
directory.
Syntax for creating a new Angular module:
Example :npm run ng -- generate module <module-name> --project=<project-name> --flat
Note: Replace
<module-name>
with the module name to create and<project-name>
with the project to put the module
Example, create a new module in the gmm library:
Example :npm run ng -- generate module modules/hello --project=nshmp-lib-ng-gmm --flat
Note: The above example creates a new
hello
module in theprojects/nshmp-lib-ng/gmm/lib/modules
directory.
The main library, projects/nshmp-lib-ng, can be built with:
Example :npm run build
This projects uses Husky to run GitHooks on pre-commit and pre-push.
On pre-commit the following run:
On pre-push the following run:
To run the linting tools, run:
Example :npm run lint
For automatic fixes, run:
Example :npm run fix