首页 > 解决方案 > Angular 6 项目在 Chrome 中运行良好,但在 IE11 中运行良好

问题描述

我的 Angular 6/Visual Studio,.net 框架 4.6.2 应用程序在 Chrome 中显示正常,但在 IE 11 中没有显示。我用谷歌搜索了这个问题,并根据 [ IE 11 使用 Angular 5 的兼容性错误未 注释并按照建议安装了 npm。

也根据:[ Angular 2 / 4 / 5 not working in IE11 added

<meta http-equiv="X-UA-Compatible" content="IE=edge" />
 <script src="https://npmcdn.com/angular2/es6/dev/src/testing/shims_for_IE.js"></script>

在 src 下的 index.html 和 Home 下的 index.cshtml 中。

当我在 IE 中执行“检查元素”时,我进入控制台:

SCRIPT1010: Expected identifier
File: vendor.js, Line: 174472, Column: 9

vendor.js from lines 174466 - 174474 gives:

// Unless required  by  applicable  law  or  agreed  to  in  writing,  software 
// distributed under the License is distributed on an "AS  IS"  BASIS,  WITHOUT
// WARRANTIES OR CONDITIONS  OF  ANY  KIND, either express or implied.  See the 
// License for the specific  language  governing  permissions  and  limitations 
// under the License.
     Object.defineProperty(exports, "__esModule", { value: true });
174472 - >function* Forward(target) {
    yield* target;
  }

请指导怎么办?

PS 这是我的 tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

标签: angularinternet-explorer-11compatibility

解决方案


推荐阅读