使Angular2兼容IE9

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

                       

使用官网的quickstart是不兼容IE9的,我们需要另外配置使其兼容IE9。

参考 https://angular.cn/docs/ts/latest/guide/browser-support.html

index.html中,除了引入shim.min.js还要引入

<!-- Polyfill(s) for older browsers -->    <script src="node_modules/core-js/client/shim.min.js"></script>    <script src="//cdnjs.cloudflare.com/ajax/libs/classlist/2014.01.31/classList.min.js"></script>
   
   
  • 1
  • 2
  • 3

另外可能还要配置路由为HashLocationStrategy。
只需要在RouterModule.forRoot中设置useHash属性:

imports :[       RouterModule.forRoot(appRoutes,{useHash:true})
   
   
  • 1
  • 2
  • 3
           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow

这里写图片描述

猜你喜欢

转载自blog.csdn.net/qq_43682817/article/details/84106926