ng 生成模块 Heroes/heroes --module app --flat --routing 在此 ng 命令中 --flat 是什么意思

Roh*_*kla 5 angular-cli angular

我正在通过 Angular 文档学习 Angular 路由,但无法理解--flatinng命令

ng generate module heroes/heroes --module app --flat --routing 
Run Code Online (Sandbox Code Playgroud)

Tha*_*hah 7

ng generate module app-routing --flat --module=app
Run Code Online (Sandbox Code Playgroud)

--flat 将文件放在 src/app 中而不是它自己的文件夹中。

--module=app 告诉 CLI 将其注册到 AppModule 的导入数组中。

在这里阅读更多内容https://angular.io/tutorial/toh-pt5


Sid*_*era 4

这是 Angular 文档必须说的:

如果为 true,则在当前项目根目录的顶层创建新文件。

默认值:假

由于您已编写heroes/heroes,这些文件将创建在名为的文件夹中heroes

在这里阅读更多相关信息