问题
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