在Firefox中使用Angular 8时遇到问题的解决方法可能因具体问题而异。以下是一些常见问题和对应的解决方法:
错误信息:"TypeError: 'caller' and 'arguments' are restricted function properties and cannot be accessed in this context."
解决方法:在项目的 polyfills.ts
文件中添加以下代码:
(window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove'];
错误信息:"TypeError: 'document.registerElement' is deprecated and will be removed in M70, around October 2018. Please use 'window.customElements.define' instead."
解决方法:在项目的 polyfills.ts
文件中添加以下代码:
(window as any).global = window;
错误信息:"SyntaxError: export declarations may only appear at top level of a module"
解决方法:确保在项目中的所有 .ts
文件中,export
语句都出现在文件的顶层。
错误信息:"TypeError: Cannot read property 'call' of undefined"
解决方法:在项目的 polyfills.ts
文件中添加以下代码:
import 'core-js/es7/reflect';
错误信息:"TypeError: Zone.current.wrap is not a function"
解决方法:更新项目的 zone.js
版本到最新版本。
如果以上解决方法不适用于你遇到的具体问题,请提供更多的错误信息和代码示例。