ran*_*kar 7 angular-cli angular angular-cli-v6
我需要创建十个Angular组件,如comp1,comp2,comp3,comp4,...,comp10.所以我需要为每个组件执行相同的命令十次,如ng gc comp1,ng gc comp2等.
是否有任何选项可以使用单个angular-cli命令生成多个角度分量,如ng gc comp1,comp2,comp3.
嗯,目前Angular CLI没有任何内容可以创建多个组件.但这可以在任何shell中轻松完成.
将此命令运行到bash shell中 -
for i in comp1 comp2; do ng g c "${i}"; done
Run Code Online (Sandbox Code Playgroud)
特别感谢IngoBürk的回答
小智 7
如果您不想创建脚本,这里有一个可行的方法
ng 气相色谱组件/接触 ng GC 组件/登录 ng GC 组件/注册 ng GC 组件/仪表板
Microsoft Windows 变体
在根:
for %n in (component-name-1, component-name-2, ...) do ng g c %n
Run Code Online (Sandbox Code Playgroud)
在模块中:
for %n in (component-name-1, component-name-2, ...) do ng g c module-name/%n
Run Code Online (Sandbox Code Playgroud)
在模块中,没有测试:
for %n in (component-name-1, component-name-2, ...) do ng g c module-name/%n --skipTests=true
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2556 次 |
| 最近记录: |