打开材质菜单时,带有材质8的Angular 8应用程序在IE11上引发以下错误:
Unable to get property 'opacity' of undefined or null reference
在角度7.2时效果很好。 二手IE11版本:11.1146.16299.0更新版本:11.0.125
新的项目依赖项版本:
"dependencies": {
"@angular/animations": "^8.0.0",
"@angular/cdk": "^8.0.0",
"@angular/common": "~8.0.0",
"@angular/compiler": "~8.0.0",
"@angular/core": "~8.0.0",
"@angular/forms": "~8.0.0",
"@angular/material": "^8.0.0",
"@angular/platform-browser": "~8.0.0",
"@angular/platform-browser-dynamic": "~8.0.0",
"@angular/router": "~8.0.0",
"classlist.js": "^1.1.20150312",
"core-js": "^3.1.3",
"rxjs": "~6.5.2",
"tslib": "^1.9.0",
"web-animations-js": "github:angular/web-animations-js#release_pr208",
"zone.js": "~0.9.1"
}
简单菜单
<mat-menu #appMenu="matMenu">
<button mat-menu-item>Menu Item 1</button>
</mat-menu>
<button mat-button [matMenuTriggerFor]="appMenu">
Menu
</button>
已使用的填埋物:
import 'classlist.js'; // Run `npm install --save classlist.js`.
import 'web-animations-js'; // Run `npm install --save web-animations-js`.
我用新创建的angular 8应用程序(仅包含应用程序组件中的菜单)验证了该问题。
有人对如何解决此问题有任何建议吗?谢谢
答案 0 :(得分:4)
尝试将$ReadOnly
添加到polyfill