January 14, 2017

“Intl is not defined” with Angular 2

If you are using the date, currency, decimal or percent pipes in Angular 2 make sure to add the required Intl Polyfill to your application before you ship it to production. The Internationalization API is not yet implemented in all browser versions out there. If you forget this you’ll receive the Intl is not defined error in many browsers. Especially Internet Explorer 9 and 10. You can get a full overview at caniuse.com

Dependent on what features of Angular 2 are used, you actually might need some other polyfills. So make sure to check the browser support page on angular.io before you release your app to the web.

Following an example on how to add Intl Polyfill to angular-cli:

Update your polyfill.ts

Thats it!

Related Posts

Avatar photo

theCodeCampus
Developer at thecodecampus </>

Our knowledge is not simply gained through reading - it is trained, tested and constantly being expanded. Because first and foremost, we are all developers at W11K. The know-how that we acquire here as developers, consultants and information architects flows immediately into our training courses and articles for theCodeCampus.


3 responses to ““Intl is not defined” with Angular 2”

  1. icgok says:

    wonderful

  2. Atreides says:

    Great!!!

  3. mr yang says:

    unbelievable

Leave a Reply

Add code to your comment in Markdown syntax.
Like this:
`inline example`

```
code block
example
```

Your email address will not be published.