We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
因为在 echarts.js 的实现里面,使用了 setTimeout ,被 zone.js 包装了的 setTimeout 会频繁触发 docheck 的钩子,如果应用中有组件实现了该生命周期的钩子,将会不断触发,导致性能下降。
setTimeout
zone.js
docheck
可以用 NgZone 提供的 runOutsideAngular 方法优化:
NgZone
runOutsideAngular
constructor(private zone: NgZone) {} .... this.zone.runOutsideAngular(() => { this.chart = echarts.init(this.host.nativeElement, this.theme, this.style ? {}:this.opts); });
The text was updated successfully, but these errors were encountered:
感谢建议,晚点更新上库
Sorry, something went wrong.
47c54de
No branches or pull requests
因为在 echarts.js 的实现里面,使用了
setTimeout
,被zone.js
包装了的setTimeout
会频繁触发docheck
的钩子,如果应用中有组件实现了该生命周期的钩子,将会不断触发,导致性能下降。可以用
NgZone
提供的runOutsideAngular
方法优化:The text was updated successfully, but these errors were encountered: