简体   繁体   English

angular 中的组件名称 2+

[英]Component name in angular 2+

When we execute ng g c componentname then it generate files with suffix . component.ts当我们执行ng g c componentname时,它会生成带有后缀的文件. component.ts . component.ts . . component.ts For instance:例如:

ng g c suruchi will create files suruchi.component.ts i want generated component files name to be only suruchi.ts ng g c suruchi将创建文件suruchi.component.ts我希望生成的组件文件名称仅为 suruchi.ts

Kindly suggest any provision.It will be appreciated.请提出任何规定。将不胜感激。

Try this: ng g c suruchi --type=试试这个:ng g c suruchi --type=

I think there is no cli command for generate component without .component suffix.我认为没有 .component 后缀的没有用于生成组件的 cli 命令。 So you have to create files manually and then add the reference in the module file.所以你必须手动创建文件,然后在模块文件中添加引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM