From 808275a9d5258f681cb8015ffe47f1514dc092b3 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Thu, 24 Nov 2016 11:32:28 +0100 Subject: [PATCH] feat(core): expose destroy() method on ViewRef --- modules/@angular/core/src/linker/view_ref.ts | 10 +++++----- tools/public_api_guard/core/index.d.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/@angular/core/src/linker/view_ref.ts b/modules/@angular/core/src/linker/view_ref.ts index 24948f6d9c..0d1313a5c9 100644 --- a/modules/@angular/core/src/linker/view_ref.ts +++ b/modules/@angular/core/src/linker/view_ref.ts @@ -18,6 +18,11 @@ import {AppView} from './view'; * @stable */ export abstract class ViewRef extends ChangeDetectorRef { + /** + * Destroys the view and all of the data structures associated with it. + */ + abstract destroy(): void; + get destroyed(): boolean { return unimplemented(); } abstract onDestroy(callback: Function): any /** TODO #9100 */; @@ -81,11 +86,6 @@ export abstract class EmbeddedViewRef extends ViewRef { get context(): C { return unimplemented(); } get rootNodes(): any[] { return unimplemented(); }; - - /** - * Destroys the view and all of the data structures associated with it. - */ - abstract destroy(): void; } export class ViewRef_ implements EmbeddedViewRef, ChangeDetectorRef { diff --git a/tools/public_api_guard/core/index.d.ts b/tools/public_api_guard/core/index.d.ts index 4e390cf629..432b6f62e3 100644 --- a/tools/public_api_guard/core/index.d.ts +++ b/tools/public_api_guard/core/index.d.ts @@ -399,7 +399,6 @@ export declare class ElementRef { export declare abstract class EmbeddedViewRef extends ViewRef { context: C; rootNodes: any[]; - abstract destroy(): void; } /** @stable */ @@ -1002,6 +1001,7 @@ export declare enum ViewEncapsulation { /** @stable */ export declare abstract class ViewRef extends ChangeDetectorRef { destroyed: boolean; + abstract destroy(): void; abstract onDestroy(callback: Function): any; }