date pipe issue on IE10 - 'Intl' is undefined

拟墨画扇 提交于 2019-12-23 13:16:01

问题


I have the following simple example that uses the Angular 2 date pipe which works fine in IE11 but fails on IE10:

@Component({
  selector: 'my-app',
  template: 'my date: {{ myDate | date }}'
})
export class AppComponent {
  myDate: Date = new Date();
}

One IE10, it errors out with 'Intl' is undefined. The shim was properly loaded just like the quickstart example.

Here's the plunker - http://plnkr.co/edit/rJIAay1mRXnnFtNvmM7x?p=preview

If you turn on IE10 emulation mode in the F12 tool then the error occurs. How do I get around this issue on the IE10 browser?


回答1:


The (only) reasonable explanation is that Intl isn't polyfilled.

As core-js documentation states,

ECMA-402 Intl is missed because of size. You can use this polyfill.



来源:https://stackoverflow.com/questions/40367759/date-pipe-issue-on-ie10-intl-is-undefined

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!