angular/modules/@angular/core/test/linker
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
..
change_detection_integration_spec.ts fix(compiler): Don’t throw on empty property bindings 2016-10-31 14:43:50 -07:00
direct_rendering_integration_spec.ts refactor(compiler): minor cleanup 2016-11-03 16:29:51 -07:00
entry_components_integration_spec.ts chore(lint): remove unused imports (#11923) 2016-09-27 17:12:25 -07:00
integration_spec.ts fix(compiler): support multiple components in a view container 2016-11-01 14:21:40 -07:00
ng_container_integration_spec.ts chore(lint): remove unused imports (#11923) 2016-09-27 17:12:25 -07:00
ng_module_integration_spec.ts refactor(core): remove …Metadata for all decorators and use the decorator directly. 2016-09-12 22:47:54 -07:00
projection_integration_spec.ts refactor(compiler): remove view.rootNodes and view.projectableNodes 2016-11-01 11:29:15 -07:00
query_integration_spec.ts fix(core): allow to query content of templates that are stamped out at a different place 2016-11-04 10:50:27 -07:00
query_list_spec.ts feat(core): add the find method to QueryList 2016-10-28 15:34:47 -07:00
regression_integration_spec.ts chore(lint): remove unused imports (#11923) 2016-09-27 17:12:25 -07:00
security_integration_spec.ts refactor(compiler): move host properties into DirectiveWrapper 2016-10-26 14:32:24 -07:00
system_ng_module_factory_loader_spec.ts chore(lint): remove unused imports (#11923) 2016-09-27 17:12:25 -07:00
view_injector_integration_spec.ts chore(lint): remove unused imports (#11923) 2016-09-27 17:12:25 -07:00