首页 > 解决方案 > 将 OnPush 设置为 nrwl-nx 中所有应用程序的默认值

问题描述

有没有办法让所有组件都使用 OnPush 生成?

如同:ng config schematics.@schematics/angular.component.changeDetection OnPush

标签: angularnrwl-nx

解决方案


找到了我的问题的解决方案:)

只需添加

"@schematics/angular:component": {
      "style": "scss",
      "changeDetection": "OnPush"
 }

到你workspace.json的文件最后"schematics": {}:)


推荐阅读