{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/9035","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/9035/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/9035/comments","events_url":"https://api.github.com/repos/angular/angular/issues/9035/events","html_url":"https://github.com/angular/angular/issues/9035","id":158651297,"number":9035,"title":"I think createEmbeddedView() is injecting TemplateRef in wrong location.","user":{"login":"bennadel","id":563690,"avatar_url":"https://avatars.githubusercontent.com/u/563690?v=3","gravatar_id":"","url":"https://api.github.com/users/bennadel","html_url":"https://github.com/bennadel","followers_url":"https://api.github.com/users/bennadel/followers","following_url":"https://api.github.com/users/bennadel/following{/other_user}","gists_url":"https://api.github.com/users/bennadel/gists{/gist_id}","starred_url":"https://api.github.com/users/bennadel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennadel/subscriptions","organizations_url":"https://api.github.com/users/bennadel/orgs","repos_url":"https://api.github.com/users/bennadel/repos","events_url":"https://api.github.com/users/bennadel/events{/privacy}","received_events_url":"https://api.github.com/users/bennadel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2016-06-06T10:57:34Z","updated_at":"2016-06-12T15:44:27Z","closed_at":"2016-06-06T18:52:35Z","body":"**I'm submitting a bug report**.\r\n\r\n**Current behavior**\r\n\r\nWhen a `TemplateRef` is passed into another component and then stamped-out using the `ViewContainerRef`, it appears to be injecting the `TemplateRef` relative to the original location, not relative to the current `ViewContainerRef`. I noticed this when trying something on my own. However, when I came across this behavior, I went and looked at the NG2 **specs** and it seems that your tests actually show the same behavior.\r\n\r\nI took your **specs** and pasted them into a **Plunkr**: https://plnkr.co/edit/z6LBzUPkcfPHznGz66IW?p=preview\r\n\r\nNotice that the `TemplateRef` (green border) is being rendered **next to** the `ViewContainerRef` (red border). I think the tests still pass because they are only checking the _text output_ of the resultant view, not the actual _DOM structure_. The text output happens to still be correct, in this case, but the hierarchy is wrong .... I think.\r\n\r\n**Expected/desired behavior**\r\n\r\n I _believe_ that the `TemplateRef` should be injected into the `ViewContainerRef`.\r\n\r\n**Please tell us about your environment:**\r\n\r\nRunning on Chrome Version 50.0.2661.102 (64-bit)\r\n\r\n**Angular version:** 2.0.0-beta.17 (Plunkr) and RC1 (locally) -- both show the same behavior. \r\n\r\n**Language:** TypeScript\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/225444315","html_url":"https://github.com/angular/angular/issues/9035#issuecomment-225444315","issue_url":"https://api.github.com/repos/angular/angular/issues/9035","id":225444315,"user":{"login":"sergey-koretsky","id":14143180,"avatar_url":"https://avatars.githubusercontent.com/u/14143180?v=3","gravatar_id":"","url":"https://api.github.com/users/sergey-koretsky","html_url":"https://github.com/sergey-koretsky","followers_url":"https://api.github.com/users/sergey-koretsky/followers","following_url":"https://api.github.com/users/sergey-koretsky/following{/other_user}","gists_url":"https://api.github.com/users/sergey-koretsky/gists{/gist_id}","starred_url":"https://api.github.com/users/sergey-koretsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergey-koretsky/subscriptions","organizations_url":"https://api.github.com/users/sergey-koretsky/orgs","repos_url":"https://api.github.com/users/sergey-koretsky/repos","events_url":"https://api.github.com/users/sergey-koretsky/events{/privacy}","received_events_url":"https://api.github.com/users/sergey-koretsky/received_events","type":"User","site_admin":false},"created_at":"2016-06-12T15:44:27Z","updated_at":"2016-06-12T15:44:27Z","body":"by the way https://github.com/angular/material2/tree/master/src/components - just like the best tutorial how to create your custom components ) but in any case its not enough to understand that internal angular 2 mechanics and all that 'View and friends' stuff"}}
{"actor":{"display_login":"sergey-koretsky"}}