angular/modules/@angular
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
..
benchpress refactor: remove most facades (#12399) 2016-10-21 15:14:44 -07:00
common docs(common): fix a typo in ngStyle API docs 2016-11-03 10:27:05 -07:00
compiler fix(core): allow to query content of templates that are stamped out at a different place 2016-11-04 10:50:27 -07:00
compiler-cli refactor(compiler): minor cleanup 2016-11-03 16:29:51 -07:00
core fix(core): allow to query content of templates that are stamped out at a different place 2016-11-04 10:50:27 -07:00
docs docs: remove outdated docs (#11875) 2016-09-24 08:23:28 +09:00
examples chore(lint): replace gulp check-task with tslint no-jasmine-focus rule 2016-10-28 15:53:15 -07:00
facade refactor(facade): cleanup Intl facade 2016-10-28 15:52:52 -07:00
forms docs(reset): change semi-colon to colon in code example 2016-10-26 14:56:57 -07:00
http fix(xsrf): overwrite already set xsrf header 2016-10-26 14:55:24 -07:00
platform-browser refactor(compiler): minor cleanup 2016-11-03 16:29:51 -07:00
platform-browser-dynamic refactor: simplify isPresent(x) ? x : y to x || y (#12166) 2016-10-10 09:20:58 -07:00
platform-server refactor(compiler): minor cleanup 2016-11-03 16:29:51 -07:00
platform-webworker perf(platform-browser): don’t use DomAdapter any more 2016-11-03 16:29:51 -07:00
platform-webworker-dynamic refactor: add license header to JS files & format files (#12081) 2016-10-04 20:39:20 -07:00
router fix(router): advance a route only after its children have been deactivated (#12676) 2016-11-03 16:26:10 -07:00
upgrade refactor(upgrade): spec cleanup 2016-10-27 12:12:55 -07:00
license-banner.txt build: remove JS suffix from the license banner 2016-09-13 21:48:58 -07:00
README.md docs: update README.md for npm packages 2016-09-14 17:14:02 -07:00

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

License: MIT