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:
Tsuyoshi Ito 2016-12-28 09:58:33 +09:00 committed by Hans
parent 7c210645a3
commit b2ae7b607e
2 changed files with 61 additions and 53 deletions

View File

@ -225,7 +225,33 @@ export const ContentChildren: ContentChildrenDecorator =
*/ */
export interface ContentChildDecorator { 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; (selector: Type<any>|Function|string, {read}?: {read?: any}): any;
new (selector: Type<any>|Function|string, {read}?: {read?: any}): ContentChild; new (selector: Type<any>|Function|string, {read}?: {read?: any}): ContentChild;
@ -241,30 +267,7 @@ export interface ContentChildDecorator {
export type ContentChild = Query; export type ContentChild = Query;
/** /**
* @whatItDoes Configures a content query. * ContentChild decorator and metadata.
*
* @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 * @stable
* @Annotation * @Annotation
@ -290,19 +293,6 @@ export const ContentChild: ContentChildDecorator = makePropDecorator(
*/ */
export interface ViewChildrenDecorator { export interface ViewChildrenDecorator {
/** /**
* @docsNotRequired
*/ (selector: Type<any>|Function|string, {read}?: {read?: any}): any;
new (selector: Type<any>|Function|string, {read}?: {read?: any}): ViewChildren;
}
/**
* Type of the ViewChildren metadata.
*
* @stable
*/
export type ViewChildren = Query;
/**
* @whatItDoes Configures a view query. * @whatItDoes Configures a view query.
* *
* @howToUse * @howToUse
@ -331,6 +321,23 @@ export type ViewChildren = Query;
* @stable * @stable
* @Annotation * @Annotation
*/ */
(selector: Type<any>|Function|string, {read}?: {read?: any}): any;
new (selector: Type<any>|Function|string, {read}?: {read?: any}): ViewChildren;
}
/**
* Type of the ViewChildren metadata.
*
* @stable
*/
export type ViewChildren = Query;
/**
* ViewChildren decorator and metadata.
*
* @stable
* @Annotation
*/
export const ViewChildren: ViewChildrenDecorator = makePropDecorator( export const ViewChildren: ViewChildrenDecorator = makePropDecorator(
'ViewChildren', 'ViewChildren',
[ [

View File

@ -278,7 +278,7 @@ export declare const ContentChild: ContentChildDecorator;
/** @stable */ /** @stable */
export interface ContentChildDecorator { export interface ContentChildDecorator {
(selector: Type<any> | Function | string, {read}?: { /** @stable */ (selector: Type<any> | Function | string, {read}?: {
read?: any; read?: any;
}): any; }): any;
new (selector: Type<any> | Function | string, {read}?: { new (selector: Type<any> | Function | string, {read}?: {
@ -979,7 +979,8 @@ export interface ViewChildDecorator {
export declare const ViewChildren: ViewChildrenDecorator; export declare const ViewChildren: ViewChildrenDecorator;
/** @stable */ /** @stable */
export interface ViewChildrenDecorator { (selector: Type<any> | Function | string, {read}?: { export interface ViewChildrenDecorator {
/** @stable */ (selector: Type<any> | Function | string, {read}?: {
read?: any; read?: any;
}): any; }): any;
new (selector: Type<any> | Function | string, {read}?: { new (selector: Type<any> | Function | string, {read}?: {