{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/11437","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/11437/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/11437/comments","events_url":"https://api.github.com/repos/angular/angular/issues/11437/events","html_url":"https://github.com/angular/angular/issues/11437","id":175718826,"number":11437,"title":"Router.resetConfig doesn't make child routes navigable","user":{"login":"Jonymul","id":1688260,"avatar_url":"https://avatars.githubusercontent.com/u/1688260?v=3","gravatar_id":"","url":"https://api.github.com/users/Jonymul","html_url":"https://github.com/Jonymul","followers_url":"https://api.github.com/users/Jonymul/followers","following_url":"https://api.github.com/users/Jonymul/following{/other_user}","gists_url":"https://api.github.com/users/Jonymul/gists{/gist_id}","starred_url":"https://api.github.com/users/Jonymul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jonymul/subscriptions","organizations_url":"https://api.github.com/users/Jonymul/orgs","repos_url":"https://api.github.com/users/Jonymul/repos","events_url":"https://api.github.com/users/Jonymul/events{/privacy}","received_events_url":"https://api.github.com/users/Jonymul/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20router","name":"comp: router","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-08T10:27:25Z","updated_at":"2016-09-09T18:16:00Z","closed_at":null,"body":"**I'm submitting a ...**  (check one with \"x\")\r\n```\r\n[ x ] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature 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```\r\n\r\n**Current behavior**\r\n\r\nCalling `router.resetConfig(newConfig)` makes new routes available **if** they are top-level routes. If the new routes are children of an existing route, they are not navigable, despite being visible in `router.config`.\r\n\r\n**Expected behavior**\r\n\r\nCalling `router.resetConfig(newConfig)` should make all new routes available, including children of an existing route.\r\n\r\n**Reproduction of the problem**\r\n\r\nFrom within a component, call `this.router.resetConfig()` with an updated route config -- the new routes should be children of an existing route. E.g:\r\n```\r\nlet routerConfig = this.router['config'];\r\nrouterConfig[0]._loadedConfig.routes[0].children.push({\r\n  path: `lazy-loaded-module-1`,\r\n  loadChildren: `/lazy-loaded-module-1/app.module.js#ModuleOne`\r\n});\r\nthis.router.resetConfig(routerConfig);\r\n```\r\n(I understand that the above is not strictly standard but conceptually, should still work.)\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\n\r\nMy Application needs to download additional modules after logging in. These should all be registered as child routes of an '/app' route. \r\n\r\n* `/login`\r\n* `/app`\r\n* `/app/home`\r\n* `/app/lazy-loaded-module-1 // Added at runtime`\r\n* `/app/lazy-loaded-module-2 // Added at runtime`\r\n\r\n**Please tell us about your environment:**\r\n\r\n* **Angular version:** 2.0.0-rc.5\r\n \r\n* **Browser:**  all  (Tested in Chrome 52)\r\n \r\n* **Language:** TypeScript 1.8.9\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/245995186","html_url":"https://github.com/angular/angular/issues/11437#issuecomment-245995186","issue_url":"https://api.github.com/repos/angular/angular/issues/11437","id":245995186,"user":{"login":"brandonroberts","id":42211,"avatar_url":"https://avatars.githubusercontent.com/u/42211?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonroberts","html_url":"https://github.com/brandonroberts","followers_url":"https://api.github.com/users/brandonroberts/followers","following_url":"https://api.github.com/users/brandonroberts/following{/other_user}","gists_url":"https://api.github.com/users/brandonroberts/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonroberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonroberts/subscriptions","organizations_url":"https://api.github.com/users/brandonroberts/orgs","repos_url":"https://api.github.com/users/brandonroberts/repos","events_url":"https://api.github.com/users/brandonroberts/events{/privacy}","received_events_url":"https://api.github.com/users/brandonroberts/received_events","type":"User","site_admin":false},"created_at":"2016-09-09T18:16:00Z","updated_at":"2016-09-09T18:16:00Z","body":"Are you modifying the route config of an already lazy loaded module? Here is a working example\r\n\r\nhttp://plnkr.co/edit/FDaiDvklexT68BTaNqvE?p=preview"}}
{"actor":{"display_login":"brandonroberts"}}