Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 角度8+;IE 11角度应用程序不适用于IE 11_Arrays_Angular_Internet Explorer_Build_Production - Fatal编程技术网

Arrays 角度8+;IE 11角度应用程序不适用于IE 11

Arrays 角度8+;IE 11角度应用程序不适用于IE 11,arrays,angular,internet-explorer,build,production,Arrays,Angular,Internet Explorer,Build,Production,我正在研究angular 8。我的应用程序已准备好投入生产,但它在IE11上不起作用。所有其他浏览器都可以正常工作。在IE11上,它是一个带有错误的空白页面。我通过一些网站做了如下工作。仍然不工作:)提前谢谢你的帮助 步骤1: ... "target": "es5" 步骤2: 不是9-10 IE 11 步骤3 更改polyfil.ts “仍然没有任何效果”我建议您开始使用IE进行调试。转到引发错误的各个文件。 大多数情况下,它会抛出错误以供使用 => 其他许多代码都可以。因此,您需要将这些代码

我正在研究angular 8。我的应用程序已准备好投入生产,但它在IE11上不起作用。所有其他浏览器都可以正常工作。在IE11上,它是一个带有错误的空白页面。我通过一些网站做了如下工作。仍然不工作:)提前谢谢你的帮助

步骤1:

...
"target": "es5"
步骤2: 不是9-10 IE 11

步骤3 更改polyfil.ts


“仍然没有任何效果”

我建议您开始使用IE进行调试。转到引发错误的各个文件。 大多数情况下,它会抛出错误以供使用

=>

其他许多代码都可以。因此,您需要将这些代码转换为更基本的代码。我的转换代码转到的站点是:。只需将这些代码更改为转换代码即可


希望有帮助。

您需要按照以下步骤使Angular 8应用程序在IE 11中运行:

  • tsconfig.app.json
    旁边创建一个新的tsconfig
    tsconfig-es5.app.json
    ,内容如下:

    {
     "extends": "./tsconfig.app.json",
     "compilerOptions": {
         "target": "es5" 
      }
    }
    
  • angular.json
    中,在
    build
    service
    目标下添加两个新的配置部分,以提供新的tsconfig:

    "build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
          ...
      },
      "configurations": {
        "production": {
            ...
        },
        "es5": {
          "tsConfig": "./tsconfig-es5.app.json"
        }
      }
    },
    "serve": {
      "builder": "@angular-devkit/build-angular:dev-server",
      "options": {
          ...
      },
      "configurations": {
        "production": {
         ...
        },
        "es5": {
          "browserTarget": "yourAppName:build:es5"
        }
      }
    },
    
  • 使用以下命令使用此配置运行服务:

    ng serve --configuration es5
    
    • 取消对polyfill.ts文件中某些导入的注释
    • 安装两个npm软件包
    • 修改browserslist文件(带有Angular 11项目的browserslist文件)
    在\src\polyfills.ts下取消注释几行

    // import 'classlist.js';  // Run `npm install --save classlist.js`.
    
    // import 'web-animations-js';  // Run `npm install --save web-animations-js`.
    
    安装两个npm软件包。

    npm install --save classlist.js
    npm install --save web-animations-js
    
    修改浏览器列表文件。

    npm install --save classlist.js
    npm install --save web-animations-js
    
    搜索下面的行

    not IE 9-11 # For IE 9-11 support, remove 'not'.
    
    删除not关键字

    IE 9-11 # For IE 9-11 support, remove 'not'.
    
    IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
    
    带角度11浏览器STRC文件

    删除not关键字

    IE 9-11 # For IE 9-11 support, remove 'not'.
    
    IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
    

    您添加了polyfils吗?请参见
    https://angular.io/guide/browser-support
    您会遇到什么样的错误?嘿,假设这是一个angular CLI应用程序安全吗?