W3cubDocs

/Angular

ViewRef

class

Represents an Angular view, specifically the host view that is defined by a component. Also serves as the base class that adds destroy methods for embedded views.

abstract class ViewRef extends ChangeDetectorRef {
  abstract destroyed: boolean
  abstract destroy(): void
  abstract onDestroy(callback: Function): any

  // inherited from core/ChangeDetectorRef
  abstract markForCheck(): void
  abstract detach(): void
  abstract detectChanges(): void
  abstract checkNoChanges(): void
  abstract reattach(): void
}

Subclasses

See also

Properties

Property Description
abstract destroyed: boolean Read-Only

Reports whether this view has been destroyed.

Methods

Destroys this view and all of the data structures associated with it.

abstract destroy(): void

Parameters

There are no parameters.

Returns

void

A lifecycle hook that provides additional developer-defined cleanup functionality for views.

abstract onDestroy(callback: Function): any

Parameters
callback Function

A handler function that cleans up developer-defined data associated with a view. Called when the destroy() method is invoked.

Returns

any

© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/api/core/ViewRef