component-injector
Version:
Component Injector service which allows to inject dynamically components into angular2+ projects
13 lines (12 loc) • 812 B
TypeScript
import { Component, ComponentFactory, ComponentFactoryResolver, ComponentRef, Type, ViewContainerRef } from '@angular/core';
export declare class ComponentInjector {
private resolver;
static entryComponentsFactories: ComponentFactory<any>[];
constructor(resolver: ComponentFactoryResolver);
setComponentFactories(componentsList: Type<Component>[]): void;
inject(container: ViewContainerRef, componentSelector: string): ComponentRef<any> | null;
setProperties(componentRef: ComponentRef<any>, properties: any): void;
remove(componentRef: ComponentRef<any> | null): void;
protected getComponentFactory(componentSelector: string): ComponentFactory<any>;
protected injectComponentFactory(container: ViewContainerRef, componentFactory: ComponentFactory<any>): ComponentRef<any>;
}