zn-my-lib 中文文档教程
MyLib
该库是使用 Angular CLI 版本 14.2.0 生成的。
代码脚手架
运行nggenerate component component-name --project my-lib
来生成一个新的组件。您还可以使用 nggeneratedirective|pipe|service|class|guard|interface|enum|module --project my-lib。
注意:不要忘记添加
--project my-lib
,否则它将被添加到angular.json
文件中的默认项目中。
构建
运行 ng build my-lib 来构建项目。构建工件将存储在 dist/
目录中。
发布
使用 ng build my-lib
构建库后,转到 dist 文件夹 cd dist/my-lib
并运行 npmpublish
。
运行单元测试
运行 ng test my-lib
通过 Karma 执行单元测试。
更多帮助
要获得有关 Angular CLI 的更多帮助,请使用 ng help
或查看 Angular CLI 概述和命令参考 页面。
MyLib
This library was generated with Angular CLI version 14.2.0.
Code scaffolding
Run ng generate component component-name --project my-lib
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project my-lib
.
Note: Don't forget to add
--project my-lib
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build my-lib
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build my-lib
, go to the dist folder cd dist/my-lib
and run npm publish
.
Running unit tests
Run ng test my-lib
to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.