多项目时如何通过命令行创建组件(Angular CLI 6)

How to create components through command line when there are multiple projects (Angular CLI 6)

我正在使用最新的 Angular CLI 版本 (v6)。我在 projects 文件夹中的相同代码中有多个应用程序。

我想使用命令行在这些项目中生成模块和组件

这可以通过以下方式实现。

ng generate module my-module --project=my-project1 --> creates a module in project1

ng generate component my-component--project=my-project1 --> creates a component in project1

查看我的博客 post 了解更多信息 here

如果您使用的是 CLI 旧版本 (V1),请检查