I need an app with drag drop func where components are injected into each other using ComponentFactoryResolver. Problem here is i have created a injectable event handler class which is like a shared service class responsible for creating factory and inject it into the target. Now i need to pass the (ColumnComponent) ref
Method Available :
injectComponentToTarget(sourceComponentClassName : string,targetComponentRef : any) : boolean {
let factory =
targetComponentRef._componentFactoryResolver.resolveComponentFactory(Colu
mnComponent); //Need to use sourceComponentClassName
/** rest of code for insertion **/
}
as string
Method Expected :
injectComponentToTarget(sourceComponentClassName : string,targetComponentRef : any) : boolean {
let factory =
targetComponentRef._componentFactoryResolver.resolveComponentFactory(sourceComponentClassName);
/** rest of code for insertion **/
}
As for the official Docs there is no help. I am stuck here ! Way i tried is created another file and tried exporting all Component Class Name and then
import * as ComponentClass from ../lib;
and the lib.ts
import from =
export * from 'row.component';
export * from 'column.component';
but it doesn't compile in CLI saying cannot find Module 'component/lib'