在使用Angular CLI创建新组件时,添加一个--change-detection标志,并将其设置为"OnPush",以使用.onpush变更检测模式。
示例代码:
ng generate component my-component --change-detection OnPush
上一篇:AngularCLIv13-无法运行“ng”命令。
下一篇:AngularCLIwithMVCreturning404fromAPIcall