[英]Unknown option -m in angular cli
Generate service doesn't take a module argument as services don't really “belong” to a module.生成服务不接受模块参数,因为服务并不真正“属于”模块。 To provide in root just open your service and put
要在 root 中提供,只需打开您的服务并放入
@Injectable({
providedIn: ‘root’
})
Here are the docs for service
.这里是
service
的文档。 As you can see, service does not take a module argument.正如你所看到的,服务并不需要一个模块参数。
The option --module is not available for a service : https://angular.io/cli/generate#service选项 --module 不适用于服务: https : //angular.io/cli/generate#service
But its available for a componant : https://angular.io/cli/generate#component但它可用于组件: https ://angular.io/cli/generate#component
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.