加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

使Angular2兼容IE9

发布时间:2020-12-17 09:35:08 所属栏目:安全 来源:网络整理
导读:使用官网的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/c

使用官网的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>

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

imports :[
       RouterModule.forRoot(appRoutes,{
useHash:true})

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读