0

这是 IE11 控制台 vendor.js (65816,1) 中的行;

class AppConfigCredential {
constructor(credential, secret) {
    this.credential = credential;
    this.secret = secret;
}

我正在尝试从角度读取 azure appconfiguration 的功能标志,它对除 IE11 之外的所有浏览器都运行良好,我尝试替换 polyfile 并添加 tsconfig-es5.app 并根据需要更改角度 json,但没有使用和调用函数。

enter code here
async GetFeatureToggleValue(key: any) {
   const client = new AppConfigurationClient(this.AppconfigURL);;
   return await client.getConfigurationSetting({ key: 
   ".appconfig.featureflag/" + key }, { onlyIfChanged: true }); }
4

1 回答 1

0

class关键字是在 ES2015/ES6 中引入的。Internet Explorer 11 不支持ES6和更高版本的 JavaScript。(Chrome 目前处于 ES12 中)。

您可以使用这个 SO 答案来使用babel将您的代码转换为 ES5

但是,如果可能的话,尽量避免为 IE11 本身开发,因为它将在 2022 年 6 月从 Windows 10 中删除。(来源:blog.windows.com

于 2021-09-16T15:52:33.870 回答