Angular 6.1 和 IE11。 sui-accordion-panel 不会展开。异常:对象不支持 属性 或方法 'animate'

Angular 6.1 and IE11. sui-accordion-panel doesn't expand. Exception: Object doesn't support property or method 'animate'

<sui-accordion-panel> 应该在 IE11 中展开,但 Object doesn't support property or method 'animate' 错误出现在 IE 控制台 window.

步骤

我在其中一个视图中添加了带有嵌套 <sui-accordion-panel><sui-accordion>。 代码如下所示:

//... other components 
  <div [hidden]="!isCreateNewFlag">
    <sui-accordion>
      <sui-accordion-panel [isOpen]="false">
        <div title>
          <i class="dropdown icon"></i>
          <b>Additional options</b>       
        </div>
        <div content>
          <p>Upload initial answer file. (Select the template first.)</p>
          <app-file-uploader acceptedFormat=".anx" [isDisabled]="fileUploaderDisabled" [isFileValid]="isAnswerFileValid"
            (fileUploadedEvent)="onFileUploadedEvent($event)"></app-file-uploader>
        </div>
      </sui-accordion-panel>
    </sui-accordion>
  </div>

</app-form-modal>

我创建的 <app-file-uploader> 在这里不是问题 - 即使我从上面的代码中删除它,手风琴组件也有同样的问题。

预期结果

屏幕截图显示了 chrome 网络浏览器中的预期行为。

实际结果

扩展功能在 IE11 中不起作用:

版本

这是我的 package.json 的样子:

{
  "name": "hd",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "generate-api-client": "call ../../Build/GenerateApiClient.bat",
    "predevbuild": "cpx ./src/styles/theme.config ./node_modules/semantic-ui-less/",
    "devbuild": "ng build --output-hashing none",
    "prebuild": "cpx ./src/styles/theme.config ./node_modules/semantic-ui-less/",
    "build": "ng build --prod --output-hashing none",
    "watch": "ng build --output-hashing none --watch",
    "test": "ng test --sourceMap=false --watch false",
    "test-watch": "ng test --sourceMap=false",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "6.0.7",
    "@angular/common": "6.0.7",
    "@angular/compiler": "6.0.7",
    "@angular/core": "6.0.7",
    "@angular/forms": "6.0.7",
    "@angular/http": "6.0.7",
    "@angular/platform-browser": "6.0.7",
    "@angular/platform-browser-dynamic": "6.0.7",
    "@angular/router": "6.0.7",
    "core-js": "2.5.7",
    "date-fns": "1.29.0",
    "element-resize-detector": "1.1.14",
    "lodash-es": "4.17.10",
    "ng2-semantic-ui": "0.9.7",
    "rxjs": "6.2.1",
    "semantic-ui-calendar": "0.0.8",
    "semantic-ui-less": "2.3.3",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.6.8",
    "@angular/cli": "6.0.8",
    "@angular/compiler-cli": "6.0.7",
    "@angular/language-service": "6.0.7",
    "@types/element-resize-detector": "1.1.0",
    "@types/jasmine": "2.8.8",
    "@types/jasminewd2": "2.0.3",
    "@types/lodash-es": "4.17.0",
    "@types/node": "10.5.3",
    "codelyzer": "4.4.2",
    "cpx": "1.5.0",
    "jasmine": "3.1.0",
    "jasmine-core": "3.1.0",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "2.0.4",
    "karma-chrome-launcher": "2.2.0",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "2.0.1",
    "karma-jasmine": "1.1.2",
    "karma-jasmine-html-reporter": "1.2.0",
    "less": "2.7.3",
    "protractor": "5.3.2",
    "ts-node": "7.0.0",
    "tslint": "5.10.0",
    "typescript": "2.7.2"
  }
}

您知道哪里出了问题吗?这个问题有什么解决方法吗? 干杯

<sui-accordion> 正在使用并非所有浏览器都支持的 Web Animations API。他们在这里的文档中告诉它:

为了在 angular 中更好地解决这个问题,我建议将其添加到您的 polyfill.ts 文件中(可能它已经在评论中了):

import 'web-animations-js';  

要完成这项工作,您需要 运行:npm install --save web-animations-js

您可以在此处查看实际示例:

https://stackblitz.com/edit/angular-stack-55650439?file=src%2Fpolyfills.ts