createComponent<T> method

ComponentRef<T> createComponent<T>(
  1. ComponentFactory<T> componentFactory,
  2. [int index = -1,
  3. Injector injector,
  4. List<List> projectableNodes]

Instantiates a single Component and inserts its Host View into this container at the specified index.

The component is instantiated using its ComponentFactory.

If index is not specified, the new View will be inserted as the last View in the container.

You can optionally specify the Injector that will be used as parent for the Component.

Returns the ComponentRef of the Host View created for the newly instantiated Component.


ComponentRef<T> createComponent<T>(
  ComponentFactory<T> componentFactory, [
  int index = -1,
  Injector injector,
  List<List<dynamic>> projectableNodes,