docs(ContentChild): add example with refs
Add missing example on how ContentChild works with refs Closes #7160 Closes #7162
This commit is contained in:
parent
a38c9a1ef7
commit
1513e201bb
|
@ -1089,12 +1089,21 @@ export var ContentChildren: ContentChildrenMetadataFactory =
|
||||||
* })
|
* })
|
||||||
* class SomeDir {
|
* class SomeDir {
|
||||||
* @ContentChild(ChildDirective) contentChild;
|
* @ContentChild(ChildDirective) contentChild;
|
||||||
|
* @ContentChild('container_ref') containerChild
|
||||||
*
|
*
|
||||||
* ngAfterContentInit() {
|
* ngAfterContentInit() {
|
||||||
* // contentChild is set
|
* // contentChild is set
|
||||||
|
* // containerChild is set
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* ```html
|
||||||
|
* <container #container_ref>
|
||||||
|
* <item>a</item>
|
||||||
|
* <item>b</item>
|
||||||
|
* </container>
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
export var ContentChild: ContentChildMetadataFactory = makePropDecorator(ContentChildMetadata);
|
export var ContentChild: ContentChildMetadataFactory = makePropDecorator(ContentChildMetadata);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue