简体   繁体   English

Angular 8:禁止在 polyfills.ts 上检查特定事件不起作用

[英]Angular 8: Disabling specific events from being checked on polyfills.ts isn't working

I'm developing an application in angular 8 that uses jsPlumbToolkit to display and edit flowcharts.我正在 angular 8 中开发一个应用程序,它使用 jsPlumbToolkit 来显示和编辑流程图。 However i was experiencing performance issues, so i started digging and eventually realized that the change detection from zone.js was running at every mouse move event.但是我遇到了性能问题,所以我开始挖掘并最终意识到 zone.js 的更改检测在每个鼠标移动事件中都在运行。 So i tried adding the following line to pollyfills.ts, as shown in this article .所以我尝试将以下行添加到 pollyfills.ts, 如本文所示

(window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove', 'pointermove'];

But that didn't seem to work, as every mouse event is still fired when i run chrome dev tools performace analysis.但这似乎不起作用,因为当我运行 chrome 开发工具性能分析时,每个鼠标事件仍然会被触发。

Screenshot of the performance test, showing multiple events fired where i only waved the pointer around the screen性能测试的屏幕截图,显示在我只在屏幕周围挥动指针时触发的多个事件

Any help would be greatly appreciated, as i'm currently running out of ideas.任何帮助将不胜感激,因为我目前没有想法。

Ok, i dug a little deeper and eventually came across this link:好吧,我挖得更深一些,最终发现了这个链接:

Apparently, you need to create a new file with the above flag and import it into polyfills before you import zone.js.显然,在导入 zone.js 之前,您需要使用上述标志创建一个新文件并将其导入 polyfills。 Hope this helps someone else.希望这对其他人有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 Angular 8 中 polyfills.ts 中的 zonejs“监听”事件列表涂黑不工作 - Black the zonejs “listening” event list in polyfills.ts in Angular 8 not working Angular 中 polyfills.ts 文件有什么用 - What is the use of polyfills.ts file in Angular Angular 6:polyfills.ts中的Reflect API是什么? - Angular 6: what is the Reflect API in polyfills.ts? TypeScript 编译中缺少 Angular5:polyfills.ts & \main.ts - Angular5 :polyfills.ts & \main.ts is missing from the TypeScript compilation main.ts 和 polyfills.ts 在升级到 Angular 的过程中从 Typescript 编译中丢失 9 - main.ts and polyfills.ts is missing from the Typescript compilation during upgrade to Angular 9 由于 CSP,Angular 动画在 Firefox 上不起作用(在 polyfills.ts 中使用 web-animations-js) - Angular animations not working on Firefox due to CSP (with web-animations-js in polyfills.ts) rails webpacker angular-polyfills.ts-错误:无法解析'core-js / es6 / reflect' - rails webpacker angular - polyfills.ts - Error: Can't resolve 'core-js/es6/reflect' 可以安全删除角度 polyfills.ts 文件吗 - Can angular polyfills.ts file be safely removed angular cli和Internet Explorer,取消注释polyfills.ts的缺点是什么 - angular cli and Internet Explorer, what is the cons of uncommenting polyfills.ts 我使用VS模板创建的Angular 2 ASP.NET Core应用程序中的Polyfills.ts是否缺失? - Polyfills.ts in my Angular 2 ASP.NET Core application created using VS template, are they missing?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM