Skip to content

Commit 9d4842c

Browse files
committed
Revert "docs(docs-infra): Remove unused annotation template (#50114)" (#50206)
This reverts commit a1ca162. This commit causes failures in g3, because `@Annotation` is load-bearing for tsickle's decorator downleveling transformation. PR Close #50206
1 parent 80fe08b commit 9d4842c

7 files changed

Lines changed: 40 additions & 13 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{%- if doc.decorators.length %}
2+
<section class="annotations">
3+
<h2>Annotations</h2>
4+
5+
{%- for decorator in doc.decorators %}
6+
<code-example language="ts" hideCopy="true" class="no-box api-heading{% if decorator.deprecated %} deprecated-api-item{% endif %}">@{$ decorator.name $}({$ decorator.arguments $})</code-example>
7+
8+
{%- if not decorator.notYetDocumented %}
9+
{$ decorator.description | marked $}
10+
{%- endif %}
11+
{%- endfor %}
12+
</section>
13+
{%- endif -%}

packages/core/src/di/injectable.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export interface Injectable {
8585
/**
8686
* Injectable decorator and metadata.
8787
*
88+
* @Annotation
8889
* @publicApi
8990
*/
9091
export const Injectable: InjectableDecorator = makeDecorator(

packages/core/src/di/metadata.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export interface Inject {
5454
/**
5555
* Inject decorator and metadata.
5656
*
57+
* @Annotation
5758
* @publicApi
5859
*/
5960
export const Inject: InjectDecorator = attachInjectFlag(
@@ -98,7 +99,7 @@ export interface Optional {}
9899
/**
99100
* Optional decorator and metadata.
100101
*
101-
102+
* @Annotation
102103
* @publicApi
103104
*/
104105
export const Optional: OptionalDecorator =
@@ -146,7 +147,7 @@ export interface Self {}
146147
/**
147148
* Self decorator and metadata.
148149
*
149-
150+
* @Annotation
150151
* @publicApi
151152
*/
152153
export const Self: SelfDecorator =
@@ -194,7 +195,7 @@ export interface SkipSelf {}
194195
/**
195196
* `SkipSelf` decorator and metadata.
196197
*
197-
198+
* @Annotation
198199
* @publicApi
199200
*/
200201
export const SkipSelf: SkipSelfDecorator =
@@ -237,7 +238,7 @@ export interface Host {}
237238
/**
238239
* Host decorator and metadata.
239240
*
240-
241+
* @Annotation
241242
* @publicApi
242243
*/
243244
export const Host: HostDecorator =

packages/core/src/di/metadata_attr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export interface Attribute {
5656
/**
5757
* Attribute decorator and metadata.
5858
*
59+
* @Annotation
5960
* @publicApi
6061
*/
6162
export const Attribute: AttributeDecorator = makeParamDecorator(

packages/core/src/metadata/di.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export interface ContentChildrenDecorator {
150150
*
151151
* {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}
152152
*
153+
* @Annotation
153154
*/
154155
(selector: ProviderToken<unknown>|Function|string, opts?: {
155156
descendants?: boolean,
@@ -164,6 +165,7 @@ export interface ContentChildrenDecorator {
164165
* Type of the ContentChildren metadata.
165166
*
166167
*
168+
* @Annotation
167169
* @publicApi
168170
*/
169171
export type ContentChildren = Query;
@@ -172,6 +174,7 @@ export type ContentChildren = Query;
172174
* ContentChildren decorator and metadata.
173175
*
174176
*
177+
* @Annotation
175178
* @publicApi
176179
*/
177180
export const ContentChildren: ContentChildrenDecorator = makePropDecorator(
@@ -239,6 +242,7 @@ export interface ContentChildDecorator {
239242
*
240243
* {@example core/di/ts/contentChild/content_child_example.ts region='Component'}
241244
*
245+
* @Annotation
242246
*/
243247
(selector: ProviderToken<unknown>|Function|string,
244248
opts?: {descendants?: boolean, read?: any, static?: boolean}): any;
@@ -257,7 +261,7 @@ export type ContentChild = Query;
257261
* ContentChild decorator and metadata.
258262
*
259263
*
260-
264+
* @Annotation
261265
*
262266
* @publicApi
263267
*/
@@ -324,6 +328,7 @@ export interface ViewChildrenDecorator {
324328
*
325329
* {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}
326330
*
331+
* @Annotation
327332
*/
328333
(selector: ProviderToken<unknown>|Function|string,
329334
opts?: {read?: any, emitDistinctChangesOnly?: boolean}): any;
@@ -341,7 +346,7 @@ export type ViewChildren = Query;
341346
/**
342347
* ViewChildren decorator and metadata.
343348
*
344-
349+
* @Annotation
345350
* @publicApi
346351
*/
347352
export const ViewChildren: ViewChildrenDecorator = makePropDecorator(
@@ -405,6 +410,7 @@ export interface ViewChildDecorator {
405410
*
406411
* {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}
407412
*
413+
* @Annotation
408414
*/
409415
(selector: ProviderToken<unknown>|Function|string, opts?: {read?: any, static?: boolean}): any;
410416
new(selector: ProviderToken<unknown>|Function|string,
@@ -421,7 +427,7 @@ export type ViewChild = Query;
421427
/**
422428
* ViewChild decorator and metadata.
423429
*
424-
430+
* @Annotation
425431
* @publicApi
426432
*/
427433
export const ViewChild: ViewChildDecorator = makePropDecorator(

packages/core/src/metadata/directives.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export interface DirectiveDecorator {
9898
* accessible for components outside of the NgModule.
9999
*
100100
*
101+
* @Annotation
101102
*/
102103
(obj?: Directive): TypeDecorator;
103104

@@ -110,6 +111,7 @@ export interface DirectiveDecorator {
110111
/**
111112
* Directive decorator and metadata.
112113
*
114+
* @Annotation
113115
* @publicApi
114116
*/
115117
export interface Directive {
@@ -289,6 +291,7 @@ export interface Directive {
289291
* }
290292
* ```
291293
*
294+
* @Annotation
292295
*/
293296
queries?: {[key: string]: any};
294297

@@ -508,6 +511,7 @@ export interface ComponentDecorator {
508511
* To preserve sequences of whitespace characters, use the
509512
* `ngPreserveWhitespaces` attribute.
510513
*
514+
* @Annotation
511515
*/
512516
(obj: Component): TypeDecorator;
513517
/**
@@ -659,7 +663,7 @@ export interface Component extends Directive {
659663
/**
660664
* Component decorator and metadata.
661665
*
662-
666+
* @Annotation
663667
* @publicApi
664668
*/
665669
export const Component: ComponentDecorator = makeDecorator(
@@ -737,7 +741,7 @@ export interface Pipe {
737741
}
738742

739743
/**
740-
744+
* @Annotation
741745
* @publicApi
742746
*/
743747
export const Pipe: PipeDecorator = makeDecorator(
@@ -816,7 +820,7 @@ export interface Input {
816820
}
817821

818822
/**
819-
823+
* @Annotation
820824
* @publicApi
821825
*/
822826
export const Input: InputDecorator =
@@ -866,7 +870,7 @@ export interface Output {
866870
}
867871

868872
/**
869-
873+
* @Annotation
870874
* @publicApi
871875
*/
872876
export const Output: OutputDecorator = makePropDecorator('Output', (alias?: string) => ({alias}));
@@ -925,7 +929,7 @@ export interface HostBinding {
925929
}
926930

927931
/**
928-
932+
* @Annotation
929933
* @publicApi
930934
*/
931935
export const HostBinding: HostBindingDecorator =
@@ -1029,7 +1033,7 @@ export interface HostListener {
10291033
* The global target names that can be used to prefix an event name are
10301034
* `document:`, `window:` and `body:`.
10311035
*
1032-
1036+
* @Annotation
10331037
* @publicApi
10341038
*/
10351039
export const HostListener: HostListenerDecorator =

packages/core/src/metadata/ng_module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export interface NgModule {
203203
}
204204

205205
/**
206+
* @Annotation
206207
*/
207208
export const NgModule: NgModuleDecorator = makeDecorator(
208209
'NgModule', (ngModule: NgModule) => ngModule, undefined, undefined,

0 commit comments

Comments
 (0)