Skip to content

Formatting pipes fail in Safari #10764

@johnchristopherjones

Description

@johnchristopherjones

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Using nearly any formatting pipe, including "percent", causes Angular 2 to fail in Safari 9.1.1 due to missing Intl. Safari in iOS is also implicated.

For example, the template <p>{{0.5 | percent:'1.1-1'}}</p> always raises an uncaught exception in Safari. Angular templates stop being rendered at this point.

Expected/desired behavior

Angular 2 formatting pipes should not raise uncaught exceptions in Safari.

Reproduction of the problem

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 using the default angular-cli build:

  1. Install current Angular2 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>

What is the expected behavior?

It should go.

What is the motivation / use case for changing the behavior?

Going would be good.

Please tell us about your environment:

  • Angular version: 2.0.0-rc.5
  • Browser: Safari 9.1.1 | iOS 9.3.4 Safari
  • Language: TypeScript 2.0.0

Related

This issue is related to discussion in #3333.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions