Angular6 修复Internet Explorer 11+中的语法错误;角度6+;项目

Angular6 修复Internet Explorer 11+中的语法错误;角度6+;项目,angular6,msal,angular7,msal.js,Angular6,Msal,Angular7,Msal.js,我在angular 6和angular 7项目中使用msal.js“@azure/msal angular”:“^0.1.2”,出现以下错误: SCRIPT1002: Syntax error vendor.js (64379,1) 第64379行的.js代码 class AuthenticationResult { constructor(token, tokenType) { this._token = ""; this._tokenType = ""; this.

我在
angular 6
angular 7
项目中使用msal.js
“@azure/msal angular”:“^0.1.2”
,出现以下错误:

SCRIPT1002: Syntax error
vendor.js (64379,1)
第64379行的.js代码

class AuthenticationResult {
constructor(token, tokenType) {
    this._token = "";
    this._tokenType = "";
    this._token = token;
    if (tokenType) {
        this._tokenType = tokenType;
    }
}
get token() {
    return this._token;
}
set token(value) {
    this._token = value;
}
get tokenType() {
    return this._tokenType;
}
set tokenType(value) {
    this._tokenType = value;
}}
我添加了
rxjscompat
npm模块来支持Angular 6+

已尝试对IE 11进行以下修复:

未注释的polyfills.ts

<meta http-equiv="X-UA-Compatible" content="IE=edge" />


有一个msal npm包,其工作原理基本相同。我在angular 7应用程序中使用它。

此修复程序目前对我有效

问题: NPM包
@azure/msal angular
中的dist文件夹(@azure\msal angular\dist)为IE11编译错误

修复: 重新编译ts文件(
https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular
)并将其添加到您的项目中
node\u modules\@azure\msal angular\dist

步骤

  • 克隆和npm安装
  • npm运行
    构建:模块
  • lib-es6
  • lib-es6
    文件粘贴到您的角度项目
    node_modules\@azure\msal angular\dist

  • npm开始
    你的angular项目。

    这是一个众所周知的错误,开发者计划在2019年7月至9月左右在@azure/msal angular的即将发布的1.0版中修复该错误

    资料来源:


    根据本图书馆的文件。这仅在角度(4.3-5)中受支持。不支持角度6或7。您需要等待支持Angular 7的版本

    参考:-

    Angular的MSAL库预览是核心MSAL.js的包装 支持角度(4.3到5)应用程序进行身份验证的库 使用Microsoft Azure Active Directory(AAD)的企业用户, Microsoft帐户用户(MSA),使用社交身份提供商的用户 如Facebook、Google、LinkedIn等,并访问Microsoft云 或微软图形


    这是您引用的NPM包?是 啊我想是同样的人做的。我还没有仔细研究过它的工作原理。