{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/10983","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/10983/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/10983/comments","events_url":"https://api.github.com/repos/angular/angular/issues/10983/events","html_url":"https://github.com/angular/angular/pull/10983","id":172489499,"number":10983,"title":"feat(router): export ROUTES token as public api","user":{"login":"sod","id":905328,"avatar_url":"https://avatars.githubusercontent.com/u/905328?v=3","gravatar_id":"","url":"https://api.github.com/users/sod","html_url":"https://github.com/sod","followers_url":"https://api.github.com/users/sod/followers","following_url":"https://api.github.com/users/sod/following{/other_user}","gists_url":"https://api.github.com/users/sod/gists{/gist_id}","starred_url":"https://api.github.com/users/sod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sod/subscriptions","organizations_url":"https://api.github.com/users/sod/orgs","repos_url":"https://api.github.com/users/sod/repos","events_url":"https://api.github.com/users/sod/events{/privacy}","received_events_url":"https://api.github.com/users/sod/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/cla:%20yes","name":"cla: yes","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-22T15:57:16Z","updated_at":"2016-08-24T12:10:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/angular/angular/pulls/10983","html_url":"https://github.com/angular/angular/pull/10983","diff_url":"https://github.com/angular/angular/pull/10983.diff","patch_url":"https://github.com/angular/angular/pull/10983.patch"},"body":"**What is the current behavior?** (You can also link to an open issue here)\r\n\r\nIf you want to define your routes by a factory that `compile-cli` accepts, you can't use the bundles as the ROUTES token is not public.\r\n\r\n**What is the new behavior?**\r\n\r\n```typescript\r\nimport {NgModule} from '@angular/core';\r\nimport {RouterModule, Routes, ROUTES} from '@angular/router';\r\nimport {BrowserModule} from '@angular/platform-browser';\r\n\r\nexport const _emptyRoutesArray = [];\r\n\r\nexport function _routes(): Routes {\r\n    return [\r\n        // your routes factory\r\n    ];\r\n}\r\n\r\n@NgModule({\r\n    imports: [\r\n        BrowserModule,\r\n        RouterModule.forRoot(_emptyRoutesArray),\r\n    ],\r\n    providers: [\r\n        // provide your routes as a factory\r\n        {provide: ROUTES, multi: true, useFactory: _routes},\r\n    ],\r\n    bootstrap: [\r\n        MyAppComponent\r\n    ],\r\n})\r\nexport class MyAppModule {\r\n}\r\n```\r\n\r\n**Does this PR introduce a breaking change?** (check one with \"x\")\r\n```\r\n[ ] Yes\r\n[x] No\r\n```"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/242040568","html_url":"https://github.com/angular/angular/pull/10983#issuecomment-242040568","issue_url":"https://api.github.com/repos/angular/angular/issues/10983","id":242040568,"user":{"login":"sod","id":905328,"avatar_url":"https://avatars.githubusercontent.com/u/905328?v=3","gravatar_id":"","url":"https://api.github.com/users/sod","html_url":"https://github.com/sod","followers_url":"https://api.github.com/users/sod/followers","following_url":"https://api.github.com/users/sod/following{/other_user}","gists_url":"https://api.github.com/users/sod/gists{/gist_id}","starred_url":"https://api.github.com/users/sod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sod/subscriptions","organizations_url":"https://api.github.com/users/sod/orgs","repos_url":"https://api.github.com/users/sod/repos","events_url":"https://api.github.com/users/sod/events{/privacy}","received_events_url":"https://api.github.com/users/sod/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T12:10:04Z","updated_at":"2016-08-24T12:10:04Z","body":"@vsavkin may I export the token? or is there an alternative?"}}
{"actor":{"display_login":"sod"}}