docs(Core): fix API docs for ContentChild and ViewChildren (#13656)
Move the documentations of the ContentChild and ViewChildren decorators so that they appear correctly on angular.io. Closes #13625
This commit is contained in:
parent
7c210645a3
commit
b2ae7b607e
|
@ -225,7 +225,33 @@ export const ContentChildren: ContentChildrenDecorator =
|
|||
*/
|
||||
export interface ContentChildDecorator {
|
||||
/**
|
||||
* @docsNotRequired
|
||||
* @whatItDoes Configures a content query.
|
||||
*
|
||||
* @howToUse
|
||||
*
|
||||
* {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}
|
||||
*
|
||||
* @description
|
||||
*
|
||||
* You can use ContentChild to get the first element or the directive matching the selector from
|
||||
* the content DOM. If the content DOM changes, and a new child matches the selector,
|
||||
* the property will be updated.
|
||||
*
|
||||
* Content queries are set before the `ngAfterContentInit` callback is called.
|
||||
*
|
||||
* **Metadata Properties**:
|
||||
*
|
||||
* * **selector** - the directive type or the name used for querying.
|
||||
* * **read** - read a different token from the queried element.
|
||||
*
|
||||
* Let's look at an example:
|
||||
*
|
||||
* {@example core/di/ts/contentChild/content_child_example.ts region='Component'}
|
||||
*
|
||||
* **npm package**: `@angular/core`
|
||||
*
|
||||
* @stable
|
||||
* @Annotation
|
||||
*/
|
||||
(selector: Type<any>|Function|string, {read}?: {read?: any}): any;
|
||||
new (selector: Type<any>|Function|string, {read}?: {read?: any}): ContentChild;
|
||||
|
@ -241,30 +267,7 @@ export interface ContentChildDecorator {
|
|||
export type ContentChild = Query;
|
||||
|
||||
/**
|
||||
* @whatItDoes Configures a content query.
|
||||
*
|
||||
* @howToUse
|
||||
*
|
||||
* {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}
|
||||
*
|
||||
* @description
|
||||
*
|
||||
* You can use ContentChild to get the first element or the directive matching the selector from the
|
||||
* content DOM. If the content DOM changes, and a new child matches the selector,
|
||||
* the property will be updated.
|
||||
*
|
||||
* Content queries are set before the `ngAfterContentInit` callback is called.
|
||||
*
|
||||
* **Metadata Properties**:
|
||||
*
|
||||
* * **selector** - the directive type or the name used for querying.
|
||||
* * **read** - read a different token from the queried element.
|
||||
*
|
||||
* Let's look at an example:
|
||||
*
|
||||
* {@example core/di/ts/contentChild/content_child_example.ts region='Component'}
|
||||
*
|
||||
* **npm package**: `@angular/core`
|
||||
* ContentChild decorator and metadata.
|
||||
*
|
||||
* @stable
|
||||
* @Annotation
|
||||
|
@ -290,8 +293,35 @@ export const ContentChild: ContentChildDecorator = makePropDecorator(
|
|||
*/
|
||||
export interface ViewChildrenDecorator {
|
||||
/**
|
||||
* @docsNotRequired
|
||||
*/ (selector: Type<any>|Function|string, {read}?: {read?: any}): any;
|
||||
* @whatItDoes Configures a view query.
|
||||
*
|
||||
* @howToUse
|
||||
*
|
||||
* {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}
|
||||
*
|
||||
* @description
|
||||
*
|
||||
* You can use ViewChildren to get the {@link QueryList} of elements or directives from the
|
||||
* view DOM. Any time a child element is added, removed, or moved, the query list will be updated,
|
||||
* and the changes observable of the query list will emit a new value.
|
||||
*
|
||||
* View queries are set before the `ngAfterViewInit` callback is called.
|
||||
*
|
||||
* **Metadata Properties**:
|
||||
*
|
||||
* * **selector** - the directive type or the name used for querying.
|
||||
* * **read** - read a different token from the queried elements.
|
||||
*
|
||||
* Let's look at an example:
|
||||
*
|
||||
* {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}
|
||||
*
|
||||
* **npm package**: `@angular/core`
|
||||
*
|
||||
* @stable
|
||||
* @Annotation
|
||||
*/
|
||||
(selector: Type<any>|Function|string, {read}?: {read?: any}): any;
|
||||
new (selector: Type<any>|Function|string, {read}?: {read?: any}): ViewChildren;
|
||||
}
|
||||
|
||||
|
@ -303,30 +333,7 @@ export interface ViewChildrenDecorator {
|
|||
export type ViewChildren = Query;
|
||||
|
||||
/**
|
||||
* @whatItDoes Configures a view query.
|
||||
*
|
||||
* @howToUse
|
||||
*
|
||||
* {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}
|
||||
*
|
||||
* @description
|
||||
*
|
||||
* You can use ViewChildren to get the {@link QueryList} of elements or directives from the
|
||||
* view DOM. Any time a child element is added, removed, or moved, the query list will be updated,
|
||||
* and the changes observable of the query list will emit a new value.
|
||||
*
|
||||
* View queries are set before the `ngAfterViewInit` callback is called.
|
||||
*
|
||||
* **Metadata Properties**:
|
||||
*
|
||||
* * **selector** - the directive type or the name used for querying.
|
||||
* * **read** - read a different token from the queried elements.
|
||||
*
|
||||
* Let's look at an example:
|
||||
*
|
||||
* {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}
|
||||
*
|
||||
* **npm package**: `@angular/core`
|
||||
* ViewChildren decorator and metadata.
|
||||
*
|
||||
* @stable
|
||||
* @Annotation
|
||||
|
|
|
@ -278,7 +278,7 @@ export declare const ContentChild: ContentChildDecorator;
|
|||
|
||||
/** @stable */
|
||||
export interface ContentChildDecorator {
|
||||
(selector: Type<any> | Function | string, {read}?: {
|
||||
/** @stable */ (selector: Type<any> | Function | string, {read}?: {
|
||||
read?: any;
|
||||
}): any;
|
||||
new (selector: Type<any> | Function | string, {read}?: {
|
||||
|
@ -979,7 +979,8 @@ export interface ViewChildDecorator {
|
|||
export declare const ViewChildren: ViewChildrenDecorator;
|
||||
|
||||
/** @stable */
|
||||
export interface ViewChildrenDecorator { (selector: Type<any> | Function | string, {read}?: {
|
||||
export interface ViewChildrenDecorator {
|
||||
/** @stable */ (selector: Type<any> | Function | string, {read}?: {
|
||||
read?: any;
|
||||
}): any;
|
||||
new (selector: Type<any> | Function | string, {read}?: {
|
||||
|
|
Loading…
Reference in New Issue