Ng-conent provides @contentChild and @ContentChildren to retrieve components contained in ng-Conent (similar to @viewChild and @ViewChildren).

An example:

The app-Content-section node contains all child nodes to be selected:

Internal layout of app-content-section:

Using the @contentChild annotation, pass in the child node ID and get the ChildComponent:

More of Jerry’s original articles can be found in “Wang Zixi” :