angular - NullInjectorError:在 IE 11 中没有用于 Angular 9 应用程序的函数 DomSharedStylesHost(_doc) 的提供程序,具有角度材料 9.1
问题描述
我正在使用带有角材料 9.1 的 anuglar 9 应用程序。我可以看到该应用程序在 Chrome、MS Edge、mozilla 中运行良好。但是对于 IE 11,我在控制台中收到以下错误。
其中一个组件是使用 Renderer2 将元素动态添加到 HTML 页面。我不知道这个错误的修复方法是什么。
解决方案
我正在使用带有 Angular + Angular 材料的 .net 作为前端。我们在 IE11 中遇到了上述问题。我正在添加特定的 polyfill。此外,错误消息正在重定向其他解决方案。最后我决定包含所有的 polyfill。感谢博日诺夫斯基。
这是我在 bundleconfig.cs 中添加的代码。
bundles.Add(new Bundle("~/bundles/angular")
.IncludeDirectory("~/dist/libs/", "*.js", true)
.Include("~/dist/libs/runtime*",
"~/dist/libs/polyfills*",
"~/dist/libs/vendor*",
"~/dist/libs/main*"));
推荐阅读
- julia - 增加 Plots.jl 中图例标签之间的间距/填充
- linux - /home/user 位于哪里?(/dev/sda1)
- javascript - 只有当参数为真时,我如何才能传递参数?
- python - 熊猫数据框争吵 - Python
- java - Swagger 客户端生成器 - 与 Response.class 冲突
- python - 将大数据集保存在 h5 文件中
- node.js - mocha 测试失败,未知选项 -r
- containers - 使用 fakeroot 构建的奇点给出了一个无效的参数错误
- r - 如何为 R 中的分类数据生成自举置信区间?
- excel - 添加一个“。” 到工作簿的名称而不更改其在 VBA 中的格式