{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/12094","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/12094/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/12094/comments","events_url":"https://api.github.com/repos/angular/angular/issues/12094/events","html_url":"https://github.com/angular/angular/issues/12094","id":181191347,"number":12094,"title":"Unable to use ContentChildren with ngForTemplate","user":{"login":"colinkahn","id":1444385,"avatar_url":"https://avatars.githubusercontent.com/u/1444385?v=3","gravatar_id":"","url":"https://api.github.com/users/colinkahn","html_url":"https://github.com/colinkahn","followers_url":"https://api.github.com/users/colinkahn/followers","following_url":"https://api.github.com/users/colinkahn/following{/other_user}","gists_url":"https://api.github.com/users/colinkahn/gists{/gist_id}","starred_url":"https://api.github.com/users/colinkahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colinkahn/subscriptions","organizations_url":"https://api.github.com/users/colinkahn/orgs","repos_url":"https://api.github.com/users/colinkahn/repos","events_url":"https://api.github.com/users/colinkahn/events{/privacy}","received_events_url":"https://api.github.com/users/colinkahn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-05T15:41:43Z","updated_at":"2016-10-05T15:48:40Z","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\nGetting directives with `@ContentChildren` does not work when the directives were created using `ngForTemplate`.\r\n\r\n**Expected behavior**\r\nDirectives inside repeated templates using `ngForTemplate` should be picked up by `@ContentChildren` like they would if you were using `ng-content`.\r\n\r\n**Minimal reproduction of the problem with instructions**\r\nhttps://plnkr.co/edit/pt3fgjvL7yREdHKWl8IZ?p=preview\r\n\r\nCheck `src/app.ts`. You'll see that the `Marker` directive is being repeated by the template passed to `Repeater`, but `Repeater` cannot use `@ContentChildren` to query for `Marker`s.\r\n\r\n**What is the motivation / use case for changing the behavior?**\r\nIn general, this seems like it should work. My specific use case is making a pair of components, each that use `ngForTemplate` with one used inside the others template. Together they allow filtering of a collection whose items have sub-items. One feature is that if all items have been filtered out (IE, no matching results) a message should be shown. I would assume the way to do this would be to query for items from the parent and subscribe to changes.\r\n\r\n**Please tell us about your environment:**\r\nReproducible in Plunker.\r\n\r\n* **Angular version:** 2.0.X\r\n2.0.1\r\n\r\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 ]\r\nTested in Chrome\r\n \r\n* **Language:** TypeScript 2\r\n\r\n* **Node (for AoT issues):** `node --version` =   \r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/251714952","html_url":"https://github.com/angular/angular/issues/12094#issuecomment-251714952","issue_url":"https://api.github.com/repos/angular/angular/issues/12094","id":251714952,"user":{"login":"pkozlowski-opensource","id":973550,"avatar_url":"https://avatars.githubusercontent.com/u/973550?v=3","gravatar_id":"","url":"https://api.github.com/users/pkozlowski-opensource","html_url":"https://github.com/pkozlowski-opensource","followers_url":"https://api.github.com/users/pkozlowski-opensource/followers","following_url":"https://api.github.com/users/pkozlowski-opensource/following{/other_user}","gists_url":"https://api.github.com/users/pkozlowski-opensource/gists{/gist_id}","starred_url":"https://api.github.com/users/pkozlowski-opensource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkozlowski-opensource/subscriptions","organizations_url":"https://api.github.com/users/pkozlowski-opensource/orgs","repos_url":"https://api.github.com/users/pkozlowski-opensource/repos","events_url":"https://api.github.com/users/pkozlowski-opensource/events{/privacy}","received_events_url":"https://api.github.com/users/pkozlowski-opensource/received_events","type":"User","site_admin":false},"created_at":"2016-10-05T15:48:40Z","updated_at":"2016-10-05T15:48:40Z","body":"If you want to observe changes to directives rolled out by `ngFor` in your example, you would like to query for `ViewChildren` and not `ContentChildren`. In your plunker content is:\r\n\r\n```\r\n<template let-n>\r\n    <marker>{{n}}</marker>\r\n  </template>\r\n```\r\n\r\nwhile view:\r\n\r\n```\r\n<h2>Found {{markers?.length}} Marker Content Children</h2>\r\n<template\r\n  ngFor\r\n  [ngForOf]=\"items\"\r\n  [ngForTemplate]=\"tmpl\"></template>\r\n```"}}
{"actor":{"display_login":"pkozlowski-opensource"}}