Angular-cli 组件生成器生成附加文件 [英] Angular-cli component generator generate additional files
本文介绍了Angular-cli 组件生成器生成附加文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法覆盖
ng generate component
命令?除了此命令默认创建的文件之外,我还想让它在创建的组件内生成一个嵌套文件夹和该文件夹中的几个文件.
command? In addition to the files that this command creates by default, I am wanting to have it generate a nested folder and several files within that folder inside the component that is created.
推荐答案
使用附加命令生成附加文件.您可以在 https://github.com/angular/angular-cli
Additional files are generated using additional commands. You can find a reference to it on https://github.com/angular/angular-cli
您可以在下表中找到所有可能的蓝图:
You can find all possible blueprints in the table below:
+-----------+---------------------------------+
| Scaffold | Usage |
+-----------+---------------------------------+
| Component | ng g component my-new-component |
+-----------+---------------------------------+
| Directive | ng g directive my-new-directive |
+-----------+---------------------------------+
| Pipe | ng g pipe my-new-pipe |
+-----------+---------------------------------+
| Service | ng g service my-new-service |
+-----------+---------------------------------+
| Class | ng g class my-new-class |
+-----------+---------------------------------+
| Interface | ng g interface my-new-interface |
+-----------+---------------------------------+
| Enum | ng g enum my-new-enum |
+-----------+---------------------------------+
| Module | ng g module my-module |
+-----------+---------------------------------+
这篇关于Angular-cli 组件生成器生成附加文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文