我尝试在 Angular(8.2.7 版)应用程序上安装Freshdesk 反馈小部件。
我使用 Freshdesk 管理门户创建了小部件嵌入代码。
小部件代码在这里:
<script>
window.fwSettings={
'widget_id': <MY PERSONAL ID>
};
!function(){if("function"!=typeof window.FreshworksWidget){var n=function(){n.q.push(arguments)};n.q=[],window.FreshworksWidget=n}}()
</script>
<script type='text/javascript' src='https://widget.freshworks.com/widgets/47000002937.js' async defer></script>
在我在标签之前插入此代码之后</body>
。
这个脚本会损坏我的 Angular 应用程序。
错误在这里:
main.ts:12 Error: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.
Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)
at Function.assertZonePatched (zone-evergreen.js:52) [<root>]
at new NgZone (core.js:39456) [<root>]
at getNgZone (core.js:40707) [<root>]
at PlatformRef.bootstrapModuleFactory (core.js:40522) [<root>]
at vendor.js:83613:31 [<root>]
at widget.freshworks.com/widgetBase/bootstrap.js:1:20208 [<root>]
如何修复此错误?
谢谢你的帮助。