From f1fb62d1e556de16c8a15054428add27fbc48fc0 Mon Sep 17 00:00:00 2001 From: Andrew Kushnir Date: Mon, 14 Jan 2019 12:44:06 -0800 Subject: [PATCH] fix(core): proper @internal and @nocollapse combined usage fix (#28138) This update fixes the way the @internal and @nocollapse annotations are used together, which produced errors while running it with Closure compiler. Now two annotations are a part of the same comment block. PR Close #28138 --- packages/core/src/change_detection/change_detector_ref.ts | 6 ++++-- packages/core/src/linker/element_ref.ts | 6 ++++-- packages/core/src/linker/template_ref.ts | 6 ++++-- packages/core/src/linker/view_container_ref.ts | 6 ++++-- packages/core/src/render/api.ts | 6 ++++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/packages/core/src/change_detection/change_detector_ref.ts b/packages/core/src/change_detection/change_detector_ref.ts index 6a570af32a..d5c023c85a 100644 --- a/packages/core/src/change_detection/change_detector_ref.ts +++ b/packages/core/src/change_detection/change_detector_ref.ts @@ -107,8 +107,10 @@ export abstract class ChangeDetectorRef { */ abstract reattach(): void; - /** @internal */ - /** @nocollapse */ + /** + * @internal + * @nocollapse + */ static __NG_ELEMENT_ID__: () => ChangeDetectorRef = () => SWITCH_CHANGE_DETECTOR_REF_FACTORY(); } diff --git a/packages/core/src/linker/element_ref.ts b/packages/core/src/linker/element_ref.ts index 4d4e69ba43..523b302ab6 100644 --- a/packages/core/src/linker/element_ref.ts +++ b/packages/core/src/linker/element_ref.ts @@ -50,8 +50,10 @@ export class ElementRef { constructor(nativeElement: T) { this.nativeElement = nativeElement; } - /** @internal */ - /** @nocollapse */ + /** + * @internal + * @nocollapse + */ static __NG_ELEMENT_ID__: () => ElementRef = () => SWITCH_ELEMENT_REF_FACTORY(ElementRef); } diff --git a/packages/core/src/linker/template_ref.ts b/packages/core/src/linker/template_ref.ts index 6c98dd704c..d4a56e7bd1 100644 --- a/packages/core/src/linker/template_ref.ts +++ b/packages/core/src/linker/template_ref.ts @@ -53,8 +53,10 @@ export abstract class TemplateRef { */ abstract createEmbeddedView(context: C): EmbeddedViewRef; - /** @internal */ - /** @nocollapse */ + /** + * @internal + * @nocollapse + */ static __NG_ELEMENT_ID__: () => TemplateRef| null = () => SWITCH_TEMPLATE_REF_FACTORY(TemplateRef, ElementRef) } diff --git a/packages/core/src/linker/view_container_ref.ts b/packages/core/src/linker/view_container_ref.ts index c410b7bfaf..00d0bf3e72 100644 --- a/packages/core/src/linker/view_container_ref.ts +++ b/packages/core/src/linker/view_container_ref.ts @@ -144,8 +144,10 @@ export abstract class ViewContainerRef { */ abstract detach(index?: number): ViewRef|null; - /** @internal */ - /** @nocollapse */ + /** + * @internal + * @nocollapse + */ static __NG_ELEMENT_ID__: () => ViewContainerRef = () => SWITCH_VIEW_CONTAINER_REF_FACTORY(ViewContainerRef, ElementRef) } diff --git a/packages/core/src/render/api.ts b/packages/core/src/render/api.ts index 7f2290b84d..8bc0147e78 100644 --- a/packages/core/src/render/api.ts +++ b/packages/core/src/render/api.ts @@ -374,8 +374,10 @@ export abstract class Renderer2 { target: 'window'|'document'|'body'|any, eventName: string, callback: (event: any) => boolean | void): () => void; - /** @internal */ - /** @nocollapse */ + /** + * @internal + * @nocollapse + */ static __NG_ELEMENT_ID__: () => Renderer2 = () => SWITCH_RENDERER2_FACTORY(); }