angular/modules
Tobias Bosch f2bbef3e33 fix(core): allow to query content of templates that are stamped out at a different place
Previously, if a `TemplateRef` was created in a `ViewContainerRef`
at a different place, the content was not query able at all.

With this change, the content of the template can be queried
as if it was stamped out at the declaration place of the template.

E.g. in the following example, the `QueryList<ChildCmp>` will
be filled once the button is clicked.

```
@Component({
  selector: ‘my-comp’,
  template: ‘<button #vc (click)=“createView()”></button>’
})
class MyComp {
  @ContentChildren(ChildCmp)
  children: QueryList<ChildCmp>;

  @ContentChildren(TemplateRef)
  template: TemplateRef;

  @ViewChild(‘vc’, {read: ViewContainerRef})
  vc: ViewContainerRef;

  createView() {
    this.vc.createEmbeddedView(this.template);
  }
}

@Component({
  template: `
<my-comp>
  <template><child-cmp></child-cmp></template>
</my-comp>
`
})
class App {}
```

Closes #12283
Closes #12094
2016-11-04 10:50:27 -07:00
..
@angular fix(core): allow to query content of templates that are stamped out at a different place 2016-11-04 10:50:27 -07:00
angular1_router style: add missing copyright headers 2016-10-31 14:25:53 -07:00
benchmarks refactor(compiler): remove view factories, use view classes directly 2016-11-02 20:58:48 -07:00
benchmarks_external style: add missing semicolons 2016-10-31 14:25:53 -07:00
e2e_util benchmarks: add ng2_ftl and ng2_switch_ftl benchmarks (#11963) 2016-09-30 09:09:31 -07:00
payload_tests/hello_world/ts style: add missing copyright headers 2016-10-31 14:25:53 -07:00
playground refactor(playground): update gestures playground to use latest hammer.js 2016-10-31 14:43:04 -07:00
rollup-test refactor: add license header to JS files & format files (#12081) 2016-10-04 20:39:20 -07:00
empty.ts chore(lint): Added license headers to most TypeScript files 2016-06-23 09:47:54 -07:00
es6-subset.d.ts chore(typings): restrict Angular to es5+collections+promise 2016-06-27 13:58:59 -07:00
system.d.ts fix(build): Remove duplicate System declarations (#10713) 2016-08-11 19:37:01 -07:00
tsconfig.json refactor(benchmarks): add index_aot to support AoT bootstrap. (#12105) 2016-10-06 08:37:37 -07:00
types.d.ts fix(build): Remove duplicate System declarations (#10713) 2016-08-11 19:37:01 -07:00