nan*_*mos 1 html javascript internet-explorer asynchronous angular
我使用*ngIf与async管显示和隐藏HTML元素。它适用于 Google Chrome 或 Firefox。但它在 Internet Explorer 上不起作用,我如何使它在 IE 上工作?
您提供的项目似乎可以在 IE 11 中正常运行。它在所有浏览器中都显示“成功消息”。在 IE 中不起作用时,控制台中是否有任何错误?您是否遵循了在 IE 11 中支持 Angular 8的步骤?
您需要按照以下步骤使 Angular 8 应用程序在 IE 11 中运行:
使用以下内容在tsconfig-es5.app.json旁边创建一个新的 tsconfig tsconfig.app.json:
{
"extends": "./tsconfig.app.json",
"compilerOptions": {
"target": "es5"
}
}
Run Code Online (Sandbox Code Playgroud)在和目标angular.json下添加两个新配置部分以提供新的 tsconfig:buildserve
"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"
}
}
},
Run Code Online (Sandbox Code Playgroud)使用以下命令使用此配置运行服务:
ng serve --configuration es5
Run Code Online (Sandbox Code Playgroud)| 归档时间: |
|
| 查看次数: |
2450 次 |
| 最近记录: |