I'm using angular 2.1 and want to dynamically import a template witch is a string from the backend.
I already use ComponentFactoryResolver
to load dynamically my parent container, now I need to create his content witch can look like this:
<my-component>
<my-nested-component>
<my-nested-component>
<my-component>
Components are already in my applications, I just need to create them from the template string and load them into the parent.
If create components from string template is not possible, is it possible to do it with lazy loading components ? I see lazy loading with the router but here I under a route and want lazy loading on some composent only
Is it possible ? I know it was possible with angular 2 beta or RC by doing this https://stackoverflow.com/a/39044539/541867
PS: if you want to know why I need to have a template as string coming from the backend it's because the UI of some component is coming from external plugin, they just use a set of component available is the application but can do the layout they want so I can't have it under a @Component
template.
EDIT: here is a gist of a first string template I try to load: https://gist.github.com/jaumard/918dfc573b01263467e89adc8ad86f77