Maybe I do not understand something, but I'm guys in a stupor. Now the customer has come up with a task. Allegedly the user interface should be easy to configure, that is, the structure comes from the server:
1st option
{
"rows": [
{"l12" : "slider-component"},
{"l6" : "process-component"},
{"l6" : "order-component"},
{"l12": "footer-component"}
]
};
2st option (the analyst can change it and get)
{
"rows": [
{"l12" : "slider-component"},
{"l6" : "search-component"},
{"l12": "footer-component"}
]
};
That is, at any time from the server comes information about the name of the component, which should be displayed in the UI. And Angular himself has to figure it out. But I can not understand, in the current version of the framework there are a lot of opportunities to create components on the fly, but everywhere we have to declare in AppModule all the components that will be compiled.
But this is stupid! At me for example, 300 components are written, the analyst in base specified components which should be deduced in UI, for example 5, and me that, to import all 300 components?
I thought that everything was really simple with JS, so the server sent us a structure, and Angular already sees the names of the components from the structure and loads the necessary * -component.js file asynchronously with its implementation, template and so on. Or I do not understand something, and I can not understand where this * -component.js will come from, if it needs to be compiled in advance via webpack (translating from typescript to javascript).
Help please, how can I realize the task assigned to me !?