Skip to content

Commit

Permalink
refactor(core): improve API documentation for query initializer APIs (#…
Browse files Browse the repository at this point in the history
…54925)

Similar to `input`, `model`, `output`, the query initializer APIs are
also explicitly denoted as such. This allows angular.dev to display them
more readable and compactly.

PR Close #54925
  • Loading branch information
devversion authored and dylhunn committed Mar 26, 2024
1 parent 318c5b0 commit 0b38172
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/core/src/authoring/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export interface ViewChildFunction {
* ```
*
* @developerPreview
* @initializerApiFunction
*/
export const viewChild: ViewChildFunction = (() => {
// Note: This may be considered a side-effect, but nothing will depend on
Expand Down Expand Up @@ -107,6 +108,9 @@ export function viewChildren<LocatorT, ReadT>(
* divEls = viewChildren<ElementRef>('el'); // Signal<ReadonlyArray<ElementRef>>
* }
* ```
*
* @initializerApiFunction
* @developerPreview
*/
export function viewChildren<LocatorT, ReadT>(
locator: ProviderToken<LocatorT>|string,
Expand Down Expand Up @@ -155,8 +159,6 @@ export interface ContentChildFunction {

/**
* Initializes a content child query that is always expected to match.
*
* @developerPreview
*/
required: {
<LocatorT>(locator: ProviderToken<LocatorT>|string, opts?: {
Expand Down Expand Up @@ -187,6 +189,9 @@ export interface ContentChildFunction {
* headerRequired = contentChild.required(MyHeader); // Signal<MyHeader>
* }
* ```
*
* @initializerApiFunction
* @developerPreview
*/
export const contentChild: ContentChildFunction = (() => {
// Note: This may be considered a side-effect, but nothing will depend on
Expand Down Expand Up @@ -220,6 +225,9 @@ export function contentChildren<LocatorT, ReadT>(
* headerEl = contentChildren<ElementRef>('h'); // Signal<ReadonlyArray<ElementRef>>
* }
* ```
*
* @initializerApiFunction
* @developerPreview
*/
export function contentChildren<LocatorT, ReadT>(
locator: ProviderToken<LocatorT>|string,
Expand Down

0 comments on commit 0b38172

Please sign in to comment.