【发布时间】:2020-01-03 17:22:24
【问题描述】:
在我的 UI 中,我有太多以网格形式排列的复选框。它们的检查状态应由组件中存在的一次性逻辑确定。一旦更新,他们的状态就永远不会改变。
我已经通过调用如下函数更新了检查状态。
[checked]="getCheckedStatus()"
此堆栈闪电战中存在简化问题 - https://stackblitz.com/edit/angular-o622bw?embed=1&file=src/app/app.component.html
问题 - 每当点击 Update 按钮时,console.log()(或者说 getCheckedStatus())被频繁触发,这会降低性能。
【问题讨论】:
标签: angular checkbox angular2-changedetection angular-changedetection