Represents an instance of a Component created via a ComponentFactory.

ComponentRef provides access to the Component Instance as well other objects related to this Component Instance and allows you to destroy the Component Instance via the #destroy method.

Constructors

ComponentRef(int _nodeIndex, AppView _parentView, Element _nativeElement, C _component)

Properties

changeDetectorRef ChangeDetectorRef
The ChangeDetectorRef of the Component instance.
read-only
componentType → Type
Returns type of component. TODO: remove use from angular router and deprecate.
read-only
hostView ViewRef
The ViewRef of the Host View of this Component instance.
read-only
injector Injector
The injector on which the component instance exists.
read-only
instance → C
The instance of the Component.
read-only
location → Element
Location of the Host Element of this Component Instance.
read-only
hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

destroy() → void
Destroys the component instance and all of the data structures associated with it.
onDestroy(OnDestroyCallback callback) → void
Allows to register a callback that will be called when the component is destroyed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(other) → bool
The equality operator. [...]
inherited