{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/19154","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/19154/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/19154/comments","events_url":"https://api.github.com/repos/angular/angular/issues/19154/events","html_url":"https://github.com/angular/angular/issues/19154","id":256965876,"number":19154,"title":"(AOT): InjectionToken not work","user":{"login":"reservoir-dogs","id":25823867,"avatar_url":"https://avatars2.githubusercontent.com/u/25823867?v=4","gravatar_id":"","url":"https://api.github.com/users/reservoir-dogs","html_url":"https://github.com/reservoir-dogs","followers_url":"https://api.github.com/users/reservoir-dogs/followers","following_url":"https://api.github.com/users/reservoir-dogs/following{/other_user}","gists_url":"https://api.github.com/users/reservoir-dogs/gists{/gist_id}","starred_url":"https://api.github.com/users/reservoir-dogs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reservoir-dogs/subscriptions","organizations_url":"https://api.github.com/users/reservoir-dogs/orgs","repos_url":"https://api.github.com/users/reservoir-dogs/repos","events_url":"https://api.github.com/users/reservoir-dogs/events{/privacy}","received_events_url":"https://api.github.com/users/reservoir-dogs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-12T08:50:43Z","updated_at":"2017-09-13T10:14:42Z","closed_at":"2017-09-13T10:14:42Z","author_association":"NONE","body":"<!--\r\nPLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.\r\n\r\nISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.\r\n-->\r\n\r\n## I'm submitting a...\r\n<!-- Check one of the following options with \"x\" -->\r\n<pre><code>\r\n[ ] Regression (a behavior that used to work and stopped working in a new release)\r\n[x ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->\r\n[ ] Feature request\r\n[ ] Documentation issue or request\r\n[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n</code></pre>\r\n\r\n## Current behavior\r\nInjectionToken work very well with JIT compilation. But not with AOT.\r\n\r\n## Expected behavior\r\nInjectionToken must work with AOT compilation.\r\n\r\n## Minimal reproduction of the problem with instructions\r\nLOCALE_ID use InjectionToken.\r\n\r\nAdd this in app.module\r\n`{ provide: LOCALE_ID, useValue: window.navigator.language }`\r\n\r\nAdd this in app.component\r\n`{{today |  | date}}`\r\ntoday = Date.now()\r\n\r\nActual, i have an exception :\r\n```\r\nTypeError: Cannot convert undefined or null to object\r\n    at new DateTimeFormat (native)\r\n    at intlDateFormat (https://myurl.com/vendor.bundle.js:58132:12)\r\n    at https://myurl.com/vendor.bundle.js:58193:45\r\n    at dateFormatter (https://myurl.com/vendor.bundle.js:58205:16)\r\n    at Function.webpackJsonp.../../../common/@angular/common.es5.js.DateFormatter.format (https://myurl.com/vendor.bundle.js:58248:16)\r\n    at DatePipe.webpackJsonp.../../../common/@angular/common.es5.js.DatePipe.transform (https://myurl.com/vendor.bundle.js:58611:30)\r\n    at checkAndUpdatePureExpressionInline (https://myurl.com/vendor.bundle.js:70968:38)\r\n    at checkAndUpdateNodeInline (https://myurl.com/vendor.bundle.js:71669:17)\r\n    at checkAndUpdateNode (https://myurl.com/vendor.bundle.js:71602:16)\r\n    at debugCheckAndUpdateNode (https://myurl.com/vendor.bundle.js:72463:59)\r\n```\r\nExpected, in culture fr-FR, it displays '12 sept. 2017' and in culture en-US, it displays 'Sep 12, 2017'.\r\n\r\n## What is the motivation / use case for changing the behavior?\r\nI want use i8n and have easier configuration for my apps.\r\n\r\n\r\n## Environment\r\n\r\n<pre><code>\r\nAngular version: X.Y.Z\r\n<!-- Check whether this is still an issue in the most recent Angular version -->\r\n\r\nBrowser:\r\n- [ ] Chrome (desktop) version XX\r\n- [ ] Chrome (Android) version XX\r\n- [ ] Chrome (iOS) version XX\r\n- [ ] Firefox version XX\r\n- [ ] Safari (desktop) version XX\r\n- [ ] Safari (iOS) version XX\r\n- [ ] IE version XX\r\n- [ ] Edge version XX\r\n \r\nFor Tooling issues:\r\n- Node version: XX  <!-- run `node --version` -->\r\n- Platform:  <!-- Mac, Linux, Windows -->\r\n\r\nOthers:\r\n<!-- Anything else relevant?  Operating system version, IDE, package manager, HTTP server, ... -->\r\n</code></pre>\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/329123297","html_url":"https://github.com/angular/angular/issues/19154#issuecomment-329123297","issue_url":"https://api.github.com/repos/angular/angular/issues/19154","id":329123297,"user":{"login":"reservoir-dogs","id":25823867,"avatar_url":"https://avatars2.githubusercontent.com/u/25823867?v=4","gravatar_id":"","url":"https://api.github.com/users/reservoir-dogs","html_url":"https://github.com/reservoir-dogs","followers_url":"https://api.github.com/users/reservoir-dogs/followers","following_url":"https://api.github.com/users/reservoir-dogs/following{/other_user}","gists_url":"https://api.github.com/users/reservoir-dogs/gists{/gist_id}","starred_url":"https://api.github.com/users/reservoir-dogs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reservoir-dogs/subscriptions","organizations_url":"https://api.github.com/users/reservoir-dogs/orgs","repos_url":"https://api.github.com/users/reservoir-dogs/repos","events_url":"https://api.github.com/users/reservoir-dogs/events{/privacy}","received_events_url":"https://api.github.com/users/reservoir-dogs/received_events","type":"User","site_admin":false},"created_at":"2017-09-13T10:14:42Z","updated_at":"2017-09-13T10:14:42Z","author_association":"NONE","body":"Thanks, it's clear.\r\n"}}
{"actor":{"display_login":"reservoir-dogs"}}