启用腻子脚本 polyfills.ts

  1. /* IE9, IE10 and IE11 requires all of the following polyfills. */
  2. import 'core-js/es6/symbol';
  3. import 'core-js/es6/object';
  4. import 'core-js/es6/function';
  5. import 'core-js/es6/parse-int';
  6. import 'core-js/es6/parse-float';
  7. import 'core-js/es6/number';
  8. import 'core-js/es6/math';
  9. import 'core-js/es6/string';
  10. import 'core-js/es6/date';
  11. import 'core-js/es6/array';
  12. import 'core-js/es6/regexp';
  13. import 'core-js/es6/map';
  14. import 'core-js/es6/weak-map';
  15. import 'core-js/es6/set';
  16. import 'core-js/es7/array';
  17. /** IE10 and IE11 requires the following for the Reflect API. */
  18. import 'core-js/es6/reflect';
  19. /* Evergreen browsers require these. */
  20. // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
  21. import 'core-js/es7/reflect';
  22. /** IE10 and IE11 requires the following for NgClass support on SVG elements */
  23. import 'classlist.js'; // Run `npm install --save classlist.js`.
  24. /**
  25. * Web Animations `@angular/platform-browser/animations`
  26. * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
  27. * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
  28. */
  29. import 'web-animations-js'; // Run `npm install --save web-animations-js`.
  30. import 'zone.js/dist/zone'; // Included with Angular CLI.
  31. // This polyfill adds compatibility to all Browsers supporting ES5:
  32. if ((window as any).NodeList && !NodeList.prototype.forEach) {
  33. NodeList.prototype.forEach = function(callback, thisArg) {
  34. thisArg = thisArg || window;
  35. for (let i = 0; i < this.length; i++) {
  36. callback.call(thisArg, this[i], i, this);
  37. }
  38. };
  39. }
  40. // 解决ie下报错 对象不支持matches
  41. if (!Element.prototype.matches) {
  42. Element.prototype.matches =
  43. (Element.prototype as any).matchesSelector ||
  44. (Element.prototype as any).mozMatchesSelector ||
  45. (Element.prototype as any).msMatchesSelector ||
  46. (Element.prototype as any).oMatchesSelector ||
  47. Element.prototype.webkitMatchesSelector ||
  48. function(s) {
  49. const matches = (this.document || this.ownerDocument).querySelectorAll(s);
  50. let i = matches.length;
  51. while (--i >= 0 && matches.item(i) !== this) {}
  52. return i > -1;
  53. };
  54. }

Angular8 ie兼容性解决的更多相关文章

  1. AngularJS进阶(三十五)浏览器兼容性解决之道

    浏览器兼容性解决之道 前言 浏览器兼容性一直是前端开发中不得不面对的一个问题.而最突出的就是IE.对绝大多数公司来说,兼容IE6的性价比已经很低,而IE7则几乎已经绝迹.所以,常见的兼容性下限是IE8 ...

  2. JavaScript 的setAttribute兼容性解决

    setAttribute各个浏览器都支持,但在IE7以下版本中,有些属性值还是有差异的,比如 obj.setAttribute("class","classname&qu ...

  3. WCF不支持 ASP.NET 兼容性 解决办法

    错 误提示:无法激活服务,因为它不支持 ASP.NET 兼容性.已为此应用程序启用了 ASP.NET 兼容性.请在 web.config 中关闭 ASP.NET 兼容性模式或将 AspNetCompa ...

  4. input 上传图片显示预览、调用摄像头,ios和Android的兼容性解决

    html代码: <img id="pic" src="img/pic.png"/> </span><input id=" ...

  5. border-radius,box-shadow兼容性解决办法

    css3 border-radius不支持IE8/IE7的四种解决方法 标签: cssborder-radius兼容性   时间:2016-07-18 css3 border-radius用于设置HT ...

  6. 【转】 IE6 IE7 IE8 css bug兼容性解决方法总结归纳

    1:li边距“无故”增加 任何事情都是有原因的,li边距也不例外. 先描述一下具体状况:有些时候li边距会突然增 加很多,值也不固定(只在IE6/IE7有这种现象),让人摸不着头脑,仔细“研究”发现是 ...

  7. 浏览器hack总结 详细的浏览器兼容性解决方法

    由于各浏览器对页面的解析不同,会导致页面在不同浏览器中显示的样式不一致,为了保持页面的统一,经常需要对浏览器进行兼容性问题的调试. CSS Hack 面对浏览器诸多的兼容性问题,经常需要通过CSS样式 ...

  8. Vuforia的图像识别之后的服务器下载与ARKit的兼容性解决

    2017.12.12 遇到的问题: Could not produce class with ID 75 直接关闭unity里面的Strip engine code,解决下载ab时的崩溃问题 *Str ...

  9. CSS兼容性解决方法!important的IE7,Firefox问题

    转自:http://www.codesky.net/article/201008/139903.html 1. 首先谈谈!important问题的引起(盒模型问题): 在CSS标准中,一个盒模型包括4 ...

随机推荐

  1. 为系统增加删除swap空间

    增加 1.创建/home/swap这么一个分区文件.文件大小是512000个block,一般情况下1个block为1k,所以这里空间是512M,这个空间大小自己随意定义. dd if=/dev/zer ...

  2. 获取.properties配置文件属性值

    public class TestProperties { /** * * @Title: printAllProperty * @Description: 输出所有配置信息 * @param pro ...

  3. 高德地图POI爬取_Python

    高德地图POI 官方文档:https://lbs.amap.com/api/webservice/guide/api/search#introduce 官网控制台:https://lbs.amap.c ...

  4. 零基础一分钟入门Python

    这篇文章面向所有想学python的小伙伴(甚至你从没听过编程),这篇文章将会带你以最快的速度入门python.赶快上车,时间来不及了... 一,下载和安装python 1.下载: 1.1 python ...

  5. 使用Azure DevOps Pipeline实现.Net Core程序的CD

    上一次我们讲了使用Azure DevOps Pipeline实现.Net Core程序的CI.这次我们来演示下如何使用Azure DevOps实现.Net Core程序的CD. 实现本次目标我们除了A ...

  6. CTF-WeChall-第二天

    2020.09.10 奥力给,举步维艰的时候就是要一边做一遍记,虽然慢但是不要嫌弃,要不然就是举步不前

  7. 第11课 - enum, sizeof, typedef 分析

    第11课 - enum, sizeof, typedef 分析 1. enum介绍 (1)enum是C语言中的一种自定义类型,和struct.union地位相同,格式如下: // enum每个值的最后 ...

  8. Docker实战(2):主从库搭建

    入门 基于Docker的Mysql主从复制搭建 首先安装docker 拉取mysql镜像:5.7版本 启动主从数据库容器 docker run -p 3339:3306 --name Maste -e ...

  9. java对象相等

    https://www.dutycode.com/post-140.html 简单来首,Object方法里的equals也是直接判断两个引用是否指向同一个地址,即引用同一个对象 public bool ...

  10. python文档翻译之概述

    Python是一个使用方便且功能强大的变成语言.它具有高效的高级数据结构和面向对象编程特性.其优雅的语法.动态类型.解释型特性使得它成为大多数平台上脚本和快速应用程序开发的理想语言. Python解释 ...