(
component: Type<C>,
options: {
environmentInjector: EnvironmentInjector;
hostElement?: Element;
elementInjector?: Injector;
projectableNodes?: Node[][];
directives?: (Type<unknown> | DirectiveWithBindings<unknown>)[];
bindings?: Binding[];
},
)
| 82 | * @publicApi |
| 83 | */ |
| 84 | export function createComponent<C>( |
| 85 | component: Type<C>, |
| 86 | options: { |
| 87 | environmentInjector: EnvironmentInjector; |
| 88 | hostElement?: Element; |
| 89 | elementInjector?: Injector; |
| 90 | projectableNodes?: Node[][]; |
| 91 | directives?: (Type<unknown> | DirectiveWithBindings<unknown>)[]; |
| 92 | bindings?: Binding[]; |
| 93 | }, |
| 94 | ): ComponentRef<C> { |
| 95 | ngDevMode && assertComponentDef(component); |
| 96 | const componentDef = getComponentDef(component)!; |
| 97 | const elementInjector = options.elementInjector || getNullInjector(); |
| 98 | const factory = new ComponentFactory<C>(componentDef); |
| 99 | return factory.create( |
| 100 | elementInjector, |
| 101 | options.projectableNodes, |
| 102 | options.hostElement, |
| 103 | options.environmentInjector, |
| 104 | options.directives, |
| 105 | options.bindings, |
| 106 | ); |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * An interface that describes the subset of component metadata |
no test coverage detected
searching dependent graphs…