禁用zone.js mousemove for changeDetect

时间:2018-06-12 21:15:32

标签: angular zone.js

有没有办法在不添加onPush的情况下禁用mousemove上的更改检测?

1 个答案:

答案 0 :(得分:4)

您可以在import 'zone.js/dist/zone'

之前的(window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['mousemove']; import 'zone.js/dist/zone'; 中添加此代码
function decodeHtml(html) {
  var txt = document.createElement("textarea");
  txt.innerHTML = html;
  return txt.value;
}

另见