ComponentFactory<T extends Object> class

Backing implementation behind a class T annotated with @Component.

For example, if this lives in example.dart:

@Component(
  selector: 'example',
  template: '...',
)
class Example {}

... then ExampleNgFactory is generated in example.template.dart, and can be accessed by importing this generated file. For example:

import 'example.template.dart' as ng;

getComponentFactory() {
  final ComponentFactory<ng.Example> comp = ng.ExampleNgFactory;
  // Can now use 'comp' as a ComponentFactory<Example>.
}

It is not valid to implement, extend, mix-in, or construct this type.

Constructors

ComponentFactory(String selector, HostView<T> _viewFactory())
Internal constructor for generated code only - do not invoke.
const

Properties

componentType Type
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selector String
User-defined selector in @Component(selector: '...').
final

Methods

create(Injector injector, [List<List<Object>>? projectableNodes]) ComponentRef<T>
Creates a new component with the dependency injector hierarchy.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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