angular_analyzer_plugin icon indicating copy to clipboard operation
angular_analyzer_plugin copied to clipboard

Support ContentChild / ContentChildren via @Query annotated constructors

Open MichaelRFairhurst opened this issue 8 years ago • 0 comments

Haven't seen any examples of this in our example codebase, but it might be out there somewhere.

@Component(...)
class MyComp {
  MyComp(@Query(OtherComp, first: true) OtherComp contentComp);

is (mostly?) the same as @ContentChild, and

@Component(...)
class MyComp {
  MyComp(@Query(OtherComp, first: false) QueryList<OtherComp> contentComps);

is (mostly?) the same as @ContentChildren.

Using this pattern will, just like @ContentChild, possibly result in false "not transcluded" warnings.

MichaelRFairhurst avatar May 18 '17 21:05 MichaelRFairhurst