X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions aio/tools/transforms/templates/api/includes/annotations.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{%- if doc.decorators.length %}
<section class="annotations">
<h2>Annotations</h2>

{%- for decorator in doc.decorators %}
<code-example language="ts" hideCopy="true" class="no-box api-heading{% if decorator.deprecated %} deprecated-api-item{% endif %}">@{$ decorator.name $}({$ decorator.arguments $})</code-example>

{%- if not decorator.notYetDocumented %}
{$ decorator.description | marked $}
{%- endif %}
{%- endfor %}
</section>
{%- endif -%}
1 change: 1 addition & 0 deletions packages/core/src/di/injectable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export interface Injectable {
/**
* Injectable decorator and metadata.
*
* @Annotation
* @publicApi
*/
export const Injectable: InjectableDecorator = makeDecorator(
Expand Down
9 changes: 5 additions & 4 deletions packages/core/src/di/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface Inject {
/**
* Inject decorator and metadata.
*
* @Annotation
* @publicApi
*/
export const Inject: InjectDecorator = attachInjectFlag(
Expand Down Expand Up @@ -98,7 +99,7 @@ export interface Optional {}
/**
* Optional decorator and metadata.
*

* @Annotation
* @publicApi
*/
export const Optional: OptionalDecorator =
Expand Down Expand Up @@ -146,7 +147,7 @@ export interface Self {}
/**
* Self decorator and metadata.
*

* @Annotation
* @publicApi
*/
export const Self: SelfDecorator =
Expand Down Expand Up @@ -194,7 +195,7 @@ export interface SkipSelf {}
/**
* `SkipSelf` decorator and metadata.
*

* @Annotation
* @publicApi
*/
export const SkipSelf: SkipSelfDecorator =
Expand Down Expand Up @@ -237,7 +238,7 @@ export interface Host {}
/**
* Host decorator and metadata.
*

* @Annotation
* @publicApi
*/
export const Host: HostDecorator =
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/di/metadata_attr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface Attribute {
/**
* Attribute decorator and metadata.
*
* @Annotation
* @publicApi
*/
export const Attribute: AttributeDecorator = makeParamDecorator(
Expand Down
12 changes: 9 additions & 3 deletions packages/core/src/metadata/di.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export interface ContentChildrenDecorator {
*
* {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}
*
* @Annotation
*/
(selector: ProviderToken<unknown>|Function|string, opts?: {
descendants?: boolean,
Expand All @@ -164,6 +165,7 @@ export interface ContentChildrenDecorator {
* Type of the ContentChildren metadata.
*
*
* @Annotation
* @publicApi
*/
export type ContentChildren = Query;
Expand All @@ -172,6 +174,7 @@ export type ContentChildren = Query;
* ContentChildren decorator and metadata.
*
*
* @Annotation
* @publicApi
*/
export const ContentChildren: ContentChildrenDecorator = makePropDecorator(
Expand Down Expand Up @@ -239,6 +242,7 @@ export interface ContentChildDecorator {
*
* {@example core/di/ts/contentChild/content_child_example.ts region='Component'}
*
* @Annotation
*/
(selector: ProviderToken<unknown>|Function|string,
opts?: {descendants?: boolean, read?: any, static?: boolean}): any;
Expand All @@ -257,7 +261,7 @@ export type ContentChild = Query;
* ContentChild decorator and metadata.
*
*

* @Annotation
*
* @publicApi
*/
Expand Down Expand Up @@ -324,6 +328,7 @@ export interface ViewChildrenDecorator {
*
* {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}
*
* @Annotation
*/
(selector: ProviderToken<unknown>|Function|string,
opts?: {read?: any, emitDistinctChangesOnly?: boolean}): any;
Expand All @@ -341,7 +346,7 @@ export type ViewChildren = Query;
/**
* ViewChildren decorator and metadata.
*

* @Annotation
* @publicApi
*/
export const ViewChildren: ViewChildrenDecorator = makePropDecorator(
Expand Down Expand Up @@ -405,6 +410,7 @@ export interface ViewChildDecorator {
*
* {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}
*
* @Annotation
*/
(selector: ProviderToken<unknown>|Function|string, opts?: {read?: any, static?: boolean}): any;
new(selector: ProviderToken<unknown>|Function|string,
Expand All @@ -421,7 +427,7 @@ export type ViewChild = Query;
/**
* ViewChild decorator and metadata.
*

* @Annotation
* @publicApi
*/
export const ViewChild: ViewChildDecorator = makePropDecorator(
Expand Down
16 changes: 10 additions & 6 deletions packages/core/src/metadata/directives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export interface DirectiveDecorator {
* accessible for components outside of the NgModule.
*
*
* @Annotation
*/
(obj?: Directive): TypeDecorator;

Expand All @@ -110,6 +111,7 @@ export interface DirectiveDecorator {
/**
* Directive decorator and metadata.
*
* @Annotation
* @publicApi
*/
export interface Directive {
Expand Down Expand Up @@ -289,6 +291,7 @@ export interface Directive {
* }
* ```
*
* @Annotation
*/
queries?: {[key: string]: any};

Expand Down Expand Up @@ -508,6 +511,7 @@ export interface ComponentDecorator {
* To preserve sequences of whitespace characters, use the
* `ngPreserveWhitespaces` attribute.
*
* @Annotation
*/
(obj: Component): TypeDecorator;
/**
Expand Down Expand Up @@ -659,7 +663,7 @@ export interface Component extends Directive {
/**
* Component decorator and metadata.
*

* @Annotation
* @publicApi
*/
export const Component: ComponentDecorator = makeDecorator(
Expand Down Expand Up @@ -737,7 +741,7 @@ export interface Pipe {
}

/**

* @Annotation
* @publicApi
*/
export const Pipe: PipeDecorator = makeDecorator(
Expand Down Expand Up @@ -816,7 +820,7 @@ export interface Input {
}

/**

* @Annotation
* @publicApi
*/
export const Input: InputDecorator =
Expand Down Expand Up @@ -866,7 +870,7 @@ export interface Output {
}

/**

* @Annotation
* @publicApi
*/
export const Output: OutputDecorator = makePropDecorator('Output', (alias?: string) => ({alias}));
Expand Down Expand Up @@ -925,7 +929,7 @@ export interface HostBinding {
}

/**

* @Annotation
* @publicApi
*/
export const HostBinding: HostBindingDecorator =
Expand Down Expand Up @@ -1029,7 +1033,7 @@ export interface HostListener {
* The global target names that can be used to prefix an event name are
* `document:`, `window:` and `body:`.
*

* @Annotation
* @publicApi
*/
export const HostListener: HostListenerDecorator =
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/metadata/ng_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export interface NgModule {
}

/**
* @Annotation
*/
export const NgModule: NgModuleDecorator = makeDecorator(
'NgModule', (ngModule: NgModule) => ngModule, undefined, undefined,
Expand Down
X Tutup