{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/11023","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/11023/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/11023/comments","events_url":"https://api.github.com/repos/angular/angular/issues/11023/events","html_url":"https://github.com/angular/angular/issues/11023","id":172821742,"number":11023,"title":"Parameters only available in the component target","user":{"login":"felipedrumond","id":17038136,"avatar_url":"https://avatars2.githubusercontent.com/u/17038136?v=4","gravatar_id":"","url":"https://api.github.com/users/felipedrumond","html_url":"https://github.com/felipedrumond","followers_url":"https://api.github.com/users/felipedrumond/followers","following_url":"https://api.github.com/users/felipedrumond/following{/other_user}","gists_url":"https://api.github.com/users/felipedrumond/gists{/gist_id}","starred_url":"https://api.github.com/users/felipedrumond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipedrumond/subscriptions","organizations_url":"https://api.github.com/users/felipedrumond/orgs","repos_url":"https://api.github.com/users/felipedrumond/repos","events_url":"https://api.github.com/users/felipedrumond/events{/privacy}","received_events_url":"https://api.github.com/users/felipedrumond/received_events","type":"User","site_admin":false},"labels":[{"id":375500771,"url":"https://api.github.com/repos/angular/angular/labels/comp:%20router","name":"comp: router","color":"c7def8","default":false},{"id":375497160,"url":"https://api.github.com/repos/angular/angular/labels/freq2:%20medium","name":"freq2: medium","color":"fbca04","default":false},{"id":130606845,"url":"https://api.github.com/repos/angular/angular/labels/type:%20feature","name":"type: feature","color":"EEEEEE","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/angular/angular/milestones/82","html_url":"https://github.com/angular/angular/milestone/82","labels_url":"https://api.github.com/repos/angular/angular/milestones/82/labels","id":3045967,"number":82,"title":"Backlog","description":"Milestone for triaged issues that have not yet been scheduled for resolution.","creator":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars3.githubusercontent.com/u/216296?v=4","gravatar_id":"","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"open_issues":1456,"closed_issues":85,"state":"open","created_at":"2018-01-18T16:52:20Z","updated_at":"2018-03-28T17:03:23Z","due_on":null,"closed_at":null},"comments":34,"created_at":"2016-08-23T22:22:12Z","updated_at":"2018-03-29T18:38:57Z","closed_at":null,"author_association":"NONE","body":"**I'm submitting a ...**  (check one with \"x\")\n\n```\n[ ] bug report => search github for a similar issue or PR before submitting\n[x] feature request\n[x] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\n```\n\n**Current behavior**\nWhen using a parametrized route which targets a component, only this component can access those parameters.\n\n**Expected/desired behavior**\nIt might be necessary to read the parameters in other components.\n\n**Reproduction of the problem**\nIf the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).\nConsider the following route configuration\n\n```\nexport const routes: RouterConfig = [\n { path: 'confirmation/:hashID', component: ConfirmationComponent, canActivate: [AuthGuard] },\n];\n\n```\n\nConsider the following code as part of the ConfirmationComponent\n\n```\nthis.activatedRoute.params.subscribe(params => {\n            var hashID = params['hashID'];\n        },\n```\n\nIf I use the above code in any other component, hashID won't be available. It is necessary to read location.path() and extract the hashID value.\n\n**What is the expected behavior?**\nAlthough I understand that the targeted component it the ConfirmationComponent, sometimes other components might need to have access to the parameters explicitly written in the URL.\n\n**What is the motivation / use case for changing the behavior?**\n\n**Please tell us about your environment:**\n- **Angular version:** 2.0.0-rc.4\n- **Browser:** [**all** | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] \n- **Language:** [all | **TypeScript 1.8** | ES6/7 | **ES5**]"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/377332520","html_url":"https://github.com/angular/angular/issues/11023#issuecomment-377332520","issue_url":"https://api.github.com/repos/angular/angular/issues/11023","id":377332520,"user":{"login":"RoyiNamir","id":2842123,"avatar_url":"https://avatars0.githubusercontent.com/u/2842123?v=4","gravatar_id":"","url":"https://api.github.com/users/RoyiNamir","html_url":"https://github.com/RoyiNamir","followers_url":"https://api.github.com/users/RoyiNamir/followers","following_url":"https://api.github.com/users/RoyiNamir/following{/other_user}","gists_url":"https://api.github.com/users/RoyiNamir/gists{/gist_id}","starred_url":"https://api.github.com/users/RoyiNamir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoyiNamir/subscriptions","organizations_url":"https://api.github.com/users/RoyiNamir/orgs","repos_url":"https://api.github.com/users/RoyiNamir/repos","events_url":"https://api.github.com/users/RoyiNamir/events{/privacy}","received_events_url":"https://api.github.com/users/RoyiNamir/received_events","type":"User","site_admin":false},"created_at":"2018-03-29T18:38:57Z","updated_at":"2018-03-29T18:38:57Z","author_association":"NONE","body":"For those who want Angular service which does that : \r\n\r\n```\r\nimport {Injectable}                                                        from '@angular/core';\r\nimport {ActivatedRoute, NavigationEnd, NavigationExtras, ParamMap, Router} from \"@angular/router\";\r\nimport {RouterExtensions}                                                  from \"nativescript-angular/router\";\r\nimport {NavigationOptions}                                                 from \"nativescript-angular/router/ns-location-strategy\";\r\nimport {Observable}                                                        from \"rxjs/Observable\";\r\nimport {first}                                                             from \"rxjs/operators/first\";\r\nimport {filter}                                                            from \"rxjs/operators/filter\";\r\nimport {map}                                                               from \"rxjs/operators/map\";\r\nimport {switchMap}                                                         from \"rxjs/operators/switchMap\";\r\nimport {unRegisterAndroidOnBack}                                           from \"../../utils/view.utils\";\r\n\r\n@Injectable()\r\nexport class RoutingService\r\n    {\r\n        constructor(private routerExtensions: RouterExtensions, private route: ActivatedRoute, private router: Router)\r\n        {\r\n        }\r\n        public getActivatedRouteParameter(paramName: string): Observable<ParamMap>\r\n        {\r\n            return this.router.events.pipe(filter(e => e instanceof NavigationEnd),\r\n                                           map((): ActivatedRoute =>\r\n                                               {\r\n                                                   let route = this.route;\r\n                                                   while (route.firstChild)\r\n                                                       {\r\n                                                           route = route.firstChild;\r\n                                                       }\r\n                                                   return route;\r\n                                               }),\r\n                                           filter((route: ActivatedRoute) => route.outlet === 'primary'),\r\n                                           switchMap((route: ActivatedRoute) => route.paramMap) , first());\r\n\r\n        }\r\n```"}}
{"actor":{"display_login":"RoyiNamir"}}