feat(core): expose destroy() method on ViewRef
This commit is contained in:
parent
be3784c957
commit
808275a9d5
@ -18,6 +18,11 @@ import {AppView} from './view';
|
|||||||
* @stable
|
* @stable
|
||||||
*/
|
*/
|
||||||
export abstract class ViewRef extends ChangeDetectorRef {
|
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 <boolean>unimplemented(); }
|
get destroyed(): boolean { return <boolean>unimplemented(); }
|
||||||
|
|
||||||
abstract onDestroy(callback: Function): any /** TODO #9100 */;
|
abstract onDestroy(callback: Function): any /** TODO #9100 */;
|
||||||
@ -81,11 +86,6 @@ export abstract class EmbeddedViewRef<C> extends ViewRef {
|
|||||||
get context(): C { return unimplemented(); }
|
get context(): C { return unimplemented(); }
|
||||||
|
|
||||||
get rootNodes(): any[] { return <any[]>unimplemented(); };
|
get rootNodes(): any[] { return <any[]>unimplemented(); };
|
||||||
|
|
||||||
/**
|
|
||||||
* Destroys the view and all of the data structures associated with it.
|
|
||||||
*/
|
|
||||||
abstract destroy(): void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ViewRef_<C> implements EmbeddedViewRef<C>, ChangeDetectorRef {
|
export class ViewRef_<C> implements EmbeddedViewRef<C>, ChangeDetectorRef {
|
||||||
|
2
tools/public_api_guard/core/index.d.ts
vendored
2
tools/public_api_guard/core/index.d.ts
vendored
@ -399,7 +399,6 @@ export declare class ElementRef {
|
|||||||
export declare abstract class EmbeddedViewRef<C> extends ViewRef {
|
export declare abstract class EmbeddedViewRef<C> extends ViewRef {
|
||||||
context: C;
|
context: C;
|
||||||
rootNodes: any[];
|
rootNodes: any[];
|
||||||
abstract destroy(): void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
@ -1002,6 +1001,7 @@ export declare enum ViewEncapsulation {
|
|||||||
/** @stable */
|
/** @stable */
|
||||||
export declare abstract class ViewRef extends ChangeDetectorRef {
|
export declare abstract class ViewRef extends ChangeDetectorRef {
|
||||||
destroyed: boolean;
|
destroyed: boolean;
|
||||||
|
abstract destroy(): void;
|
||||||
abstract onDestroy(callback: Function): any;
|
abstract onDestroy(callback: Function): any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user