ComponentRef<C> class

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 ComponentRef.destroy method.

Constructors

ComponentRef(HostView<void> _hostView, Element _nativeElement, C _component)

Properties

changeDetectorRef ChangeDetectorRef
The ChangeDetectorRef of the Component instance.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
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
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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onDestroy(void callback()) → void
Register a callback that will be called when the component is destroyed.
toString() String
A string representation of this object. [...]
inherited
update(void run(C instance)) → void
Runs run to apply changes to the component instance. [...]

Operators

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