1

I need to decide what component needs to be displayed based on backend response.

Eg: i get this response from backend

{ plugin: 
    { 
      id = 'inputfieldWidgetV12' 
    }
  data: {
     value = 'helloWorld'
  }
}

based on this I need to display a component inputfieldWidgetV12.ts, and pass the data to its constructor : {value = 'helloWorld'}.

how can I inject the component what i do not know during implementation?

I have tried require(plugin.id) but it didn't work.

Sanket
  • 17,295
  • 8
  • 63
  • 76
javadev28hu
  • 160
  • 1
  • 5
  • Basically I would need the same: Here there is a widgetContainer, and using DynamicComponentLoader what loads the component using a path, and adds it using loadIntoLocation().... See [example](http://plnkr.co/edit/z9bhXkqVonScYm7EqiF5) the problem is, that DynamicComponentLoader is Deprecated!, and with the advised ComponentResolver i cannot resolve a component, only if I import it... but I cannot do it, cause i do not know that... – javadev28hu Jul 26 '16 at 14:11

0 Answers0