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

时间:2018-08-17 18:12:39

标签: javascript angular angular-cli angular-cli-v6

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

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

1 个答案:

答案 0 :(得分:2)

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

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

查看我的博客文章以获取更多信息,here

如果您使用的是CLI旧版本(V1),请选中this