0

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'

4
  • Please post the exact error message in addition to "doesn't compile". Commented May 15, 2017 at 7:15
  • it says cannot find Module 'components/lib'...... Commented May 15, 2017 at 7:19
  • That doesn't look like the exact error message, at most a part of it Commented May 15, 2017 at 7:20
  • ive made the edit to the question with some more details plz check Commented May 15, 2017 at 7:21

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.