D
D
Dmitry2017-08-02 18:22:52
Angular
Dmitry, 2017-08-02 18:22:52

How to initialize dynamic components in Angular2+ layout?

I'm trying to do the following:
1. There is a main app-root component, it has a nested app-board
2. When the app-board component is initialized, a call is made to the server, a JSON response comes from it with a list of available components for the app-board.
3. Based on the received JSON, the layout (the number of rows, columns) is generated in the app-board to display the received list of components.
Question:
Is it possible to dynamically generate the layout so that it can initialize the components from the list:

<div class='row'>
<div  class='col-1' injectThis1></div>
<div  class='col-2' injectThis2></div>
</div>

in injectThis1 and injectThis2 (generated in layout after parsing JSON), you need to initialize the components

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question