Run ng generate component component-name --project ds-strate-forward-library
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project ds-strate-forward-library
.
Note: Don't forget to add
--project ds-strate-forward-library
or else it will be added to the default project in yourangular.json
file.
Run npm run build-library
to build the project. The build artifacts will be stored in the dist/
directory.
Then run npm run pack-lib
. This would create a .tgz package for the library which is to be exported into other applications to be used.
After building your library with ng build ds-strate-forward-library
, go to the dist folder cd dist/ds-strate-forward-library
and publish it using the below commands.
npm login
NB: CHANGE THE VERSION BEFORE DEPLOYING TO AVOIND CONFLICT ON NPM REPOSITORY. [KINDLY REPLACE <<ds-strate-forward-library-1.0.0.tgz>> BY THE LATEST .tgz FILE PATH]
First go into the dist folder, then in the 'ds-strate-forward-library' and run
npm publish ds-strate-forward-library-1.0.0.tgz --access public
.
Run ng test ds-strate-forward-library
to execute the unit tests via Karma.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.