所以我想生成一个具有特定类型(my-store.store.ts
)的Injectable类,但这是
ng g class my-store --type=store
既不生成spec
文件,也不添加@Injectable
装饰器。
我没有使用ng g service
命令,因为docs没有为其提供--type
选项。
我可以手动添加@Injectable
,但想自动获取规格文件。
使用--spec
标志,这样您的命令应该是
ng g class my-store --type=store --spec=true
,
您可以使用--spec
标志,如@jitender回答中所示。或者,您可以检查angular.json
文件的schematics
属性。