Skip to content

A polyfill for Intl should be included by default #1675

@johnchristopherjones

Description

@johnchristopherjones

On Safari 9.1.1 for OS X (macOS) El Capitan and iOS 9.3.3, Angular 2 raises an uncaught exception when any built-in formatting pipe is used. To work in Safari, a polyfill for Intl must be included.

This bug can be reproduced by opening the following plnkr in Safari:
http://plnkr.co/edit/ETQGYstBK8MF8YVF78Kj?p=preview

This bug can also be reproduced in angular-cli, version 1.0.0-beta.11-webpack.2:

  1. Install Angular 2.0.0-rc5 using angular-cli:
$ npm uninstall -g angular-cli && npm cache clean && npm install -g angular-cli@webpack
$ ng new intl-bug
  1. Add the following to a template in app.component.html:
<p>{{0.5 | percent:'1.1-1'}}</p>
  1. An uncaught exception will be written to the console. The template code will not appear, anything in the template after the above segment will fail to render, no further events or change detection will be handled, … basically everything breaks right there.

This bug was filed at angular/angular#10764, but closed recommending the polyfill. Since Angular 2's built-in formatting filters fail on Safari without the polyfill, it should probably be a best practice of angular-cli to include the Intl polyfill by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussiontype: faq

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions