Skip to content

Commit

Permalink
docs(Core): fix API docs for ContentChild and ViewChildren (#13656)
Browse files Browse the repository at this point in the history
Move the documentations of the ContentChild and ViewChildren decorators
so that they appear correctly on angular.io.

Closes #13625
  • Loading branch information
ti1024 authored and IgorMinar committed Jan 6, 2017
1 parent 1cd73c7 commit ec0ca01
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 53 deletions.
109 changes: 58 additions & 51 deletions modules/@angular/core/src/metadata/di.ts
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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;
}

Expand All @@ -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
Expand Down
5 changes: 3 additions & 2 deletions tools/public_api_guard/core/index.d.ts
Expand Up @@ -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}?: {
Expand Down Expand Up @@ -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}?: {
Expand Down

0 comments on commit ec0ca01

Please sign in to comment.