{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/1858","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/1858/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/1858/comments","events_url":"https://api.github.com/repos/angular/angular/issues/1858/events","html_url":"https://github.com/angular/angular/issues/1858","id":75827093,"number":1858,"title":"Can't retrieve attributes of the top-level component","user":{"login":"anakinjay","id":1062577,"avatar_url":"https://avatars0.githubusercontent.com/u/1062577?v=3","gravatar_id":"","url":"https://api.github.com/users/anakinjay","html_url":"https://github.com/anakinjay","followers_url":"https://api.github.com/users/anakinjay/followers","following_url":"https://api.github.com/users/anakinjay/following{/other_user}","gists_url":"https://api.github.com/users/anakinjay/gists{/gist_id}","starred_url":"https://api.github.com/users/anakinjay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anakinjay/subscriptions","organizations_url":"https://api.github.com/users/anakinjay/orgs","repos_url":"https://api.github.com/users/anakinjay/repos","events_url":"https://api.github.com/users/anakinjay/events{/privacy}","received_events_url":"https://api.github.com/users/anakinjay/received_events","type":"User","site_admin":false},"labels":[{"id":375501288,"url":"https://api.github.com/repos/angular/angular/labels/comp:%20core%20&%20compiler","name":"comp: core & compiler","color":"c7def8","default":false},{"id":218063111,"url":"https://api.github.com/repos/angular/angular/labels/effort2:%20medium%20(days)","name":"effort2: medium (days)","color":"bfe5bf","default":false},{"id":375496864,"url":"https://api.github.com/repos/angular/angular/labels/freq1:%20low","name":"freq1: low","color":"fbca04","default":false},{"id":375497956,"url":"https://api.github.com/repos/angular/angular/labels/severity2:%20inconvenient","name":"severity2: inconvenient","color":"0052cc","default":false},{"id":130606843,"url":"https://api.github.com/repos/angular/angular/labels/type:%20bug","name":"type: bug","color":"EEEEEE","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":74,"created_at":"2015-05-13T03:25:38Z","updated_at":"2017-07-10T12:37:46Z","closed_at":null,"body":" http://plnkr.co/edit/5731Z9N6tQ391gQtfZrA?p=preview\n\nI've been over the documentation 10 times, I've read through the source code, tutorials, the works...  and I still can't wrap my head around what I'm doing wrong.\n\nall I want to do is:\n\n``` html\n<app myTitle='my awesome title'>  \n```\n\nand access myTitle from inside the constructor.\n\nIs that possible in NG2?\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/314092737","html_url":"https://github.com/angular/angular/issues/1858#issuecomment-314092737","issue_url":"https://api.github.com/repos/angular/angular/issues/1858","id":314092737,"user":{"login":"anakinjay","id":1062577,"avatar_url":"https://avatars0.githubusercontent.com/u/1062577?v=3","gravatar_id":"","url":"https://api.github.com/users/anakinjay","html_url":"https://github.com/anakinjay","followers_url":"https://api.github.com/users/anakinjay/followers","following_url":"https://api.github.com/users/anakinjay/following{/other_user}","gists_url":"https://api.github.com/users/anakinjay/gists{/gist_id}","starred_url":"https://api.github.com/users/anakinjay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anakinjay/subscriptions","organizations_url":"https://api.github.com/users/anakinjay/orgs","repos_url":"https://api.github.com/users/anakinjay/repos","events_url":"https://api.github.com/users/anakinjay/events{/privacy}","received_events_url":"https://api.github.com/users/anakinjay/received_events","type":"User","site_admin":false},"created_at":"2017-07-10T12:37:46Z","updated_at":"2017-07-10T12:37:46Z","body":"I'm shocked that this is still an issue.  Years ago when I submitted this, this issue caused our entire business to ditch angular 2 and use react for everything. Which has worked fantastic for years, but now we have a project that requires NG2 and here I am literally two years later faced with the same problem.\r\n\r\nThat being said, I came up with a hokey work around.  I have no idea how bad this is as far as hokey factor and I'm sure it's not very performant, but i wanted to share in case it helps someone.\r\n\r\n(this assumes you give your root component the id of \"approot\" in your index.html file)\r\n\r\n      ngOnInit() {\r\n    let attrs = document.getElementById(\"approot\").attributes;\r\n    Object.keys(attrs).forEach(key => {\r\n      this[attrs[key].name] = attrs[key].value;\r\n    });\r\n  }\r\n\r\nI know it could be optimized, but this is a nice easy copy and paste thing for us to throw into app.component.ts and then not have to worry about changing anything if we later decide we need to add or modify root level attributes. \r\n"}}
{"actor":{"display_login":"anakinjay"}}