angular-cn/modules/@angular/core/src
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
..
animation refactor: remove most facades (#12399) 2016-10-21 15:14:44 -07:00
change_detection docs(change_detection): fix typo(ChangeDetectorStatus enum comment CheckedOnce -> CheckOnce) (#12683) 2016-11-03 11:23:20 -07:00
debug perf(compiler): introduce direct rendering 2016-11-03 16:29:51 -07:00
di refactor: remove most facades (#12399) 2016-10-21 15:14:44 -07:00
i18n feat(i18n): pass translation config directly into ngc (#10622) 2016-08-12 14:45:36 -07:00
linker fix(core): allow to query content of templates that are stamped out at a different place 2016-11-04 10:50:27 -07:00
metadata docs(NgModule): Fixed docs for NgModule.entryComponents (#12006) 2016-10-03 10:19:03 -07:00
profile fix(packages): use ES modules for primary build (#11120) 2016-08-30 18:07:40 -07:00
reflection refactor: remove some facades (#12335) 2016-10-19 13:42:39 -07:00
render perf(compiler): introduce direct rendering 2016-11-03 16:29:51 -07:00
testability refactor: misc cleanup (#11654) 2016-09-19 17:15:57 -07:00
util fix(core): fix decorator defalut values 2016-10-17 23:17:34 -07:00
zone refactor(NgZone): merge NgZoneImpl and NgZone (#12104) 2016-10-06 15:23:37 -07:00
application_init.ts refactor(facade): move isPromise to core private (#10573) 2016-09-18 15:55:08 -07:00
application_module.ts refactor: misc cleanup 2016-09-22 11:01:16 -07:00
application_ref.ts refactor: misc cleanup 2016-09-22 11:01:16 -07:00
application_tokens.ts refactor(facade): inline StringWrapper (#12051) 2016-10-06 15:10:27 -07:00
change_detection.ts chore(lint): Added license headers to most TypeScript files 2016-06-23 09:47:54 -07:00
console.ts refactor(core): simplify decorators 2016-09-12 22:47:54 -07:00
core.ts fix(packages): use ES modules for primary build (#11120) 2016-08-30 18:07:40 -07:00
core_private_export.ts perf(compiler): introduce direct rendering 2016-11-03 16:29:51 -07:00
di.ts refactor(core): simplify decorators 2016-09-12 22:47:54 -07:00
error_handler.ts docs(ExceptionHandler): fix API docs (#11772) 2016-09-24 07:05:43 +09:00
facade repackaging: all the repackaging changes squashed 2016-05-01 20:51:00 -07:00
linker.ts feat(router): register NgModuleFactory objects. (#11211) 2016-09-01 13:46:08 -07:00
metadata.ts refactor: misc cleanup 2016-09-22 11:01:16 -07:00
platform_core_providers.ts refactor: misc cleanup 2016-09-22 11:01:16 -07:00
render.ts chore(lint): Added license headers to most TypeScript files 2016-06-23 09:47:54 -07:00
security.ts refactor: rename SanitizationService to Sanitizer and DomSanitizationService to DomSanitizer (#11085) 2016-08-25 15:41:19 -07:00
type.ts refactor: misc cleanup 2016-09-22 11:01:16 -07:00
util.ts chore(lint): Added license headers to most TypeScript files 2016-06-23 09:47:54 -07:00
zone.ts refactor(chore): remove deprecated NgZoneError (#10822) 2016-08-15 16:10:30 -07:00