Angular 6:polyfills.ts中的Reflect API是什么?
Angular 6: what is the Reflect API in polyfills.ts?
在polyfills.ts
中,其中一行被注释掉的内容如下:
/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';
什么是'Reflect API'?它需要哪些 IE 用例?当 运行 Angular
应用程序在 IE
中时,此导入语句通常很重要吗?令人惊讶的是,Google 和 Whosebug 没有为我显示 many/any 结果。
ES6 Reflect API 为您提供了一个 Reflect 对象,让您可以调用方法、构造对象、获取和设置原型、操作和扩展属性。
Reflect 是一个内置对象,它提供了可拦截 JavaScript 操作的方法。这些方法与代理处理程序的方法相同。更多详情,请查看Reflect and the ES6 Reflect API Tutorial
从Browser compatibilitySection可以看出IE不支持Reflect,通过使用Polyfills,让我们在IE浏览器中使用Reflect。
在polyfills.ts
中,其中一行被注释掉的内容如下:
/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';
什么是'Reflect API'?它需要哪些 IE 用例?当 运行 Angular
应用程序在 IE
中时,此导入语句通常很重要吗?令人惊讶的是,Google 和 Whosebug 没有为我显示 many/any 结果。
ES6 Reflect API 为您提供了一个 Reflect 对象,让您可以调用方法、构造对象、获取和设置原型、操作和扩展属性。 Reflect 是一个内置对象,它提供了可拦截 JavaScript 操作的方法。这些方法与代理处理程序的方法相同。更多详情,请查看Reflect and the ES6 Reflect API Tutorial
从Browser compatibilitySection可以看出IE不支持Reflect,通过使用Polyfills,让我们在IE浏览器中使用Reflect。