How can I use/create dynamic template to compile dynamic Component with Angular 2.0?

后端 未结 15 1921
忘掉有多难
忘掉有多难 2020-11-21 05:14

I want to dynamically create a template. This should be used to build a ComponentType at runtime and place (even replace) it somewhere inside of the ho

15条回答
  •  天涯浪人
    2020-11-21 05:48

    This is the example of dynamic Form controls generated from server.

    https://stackblitz.com/edit/angular-t3mmg6

    This example is dynamic Form controls is in add component (This is where you can get the Formcontrols from the server). If you see addcomponent method you can see the Forms Controls. In this example I am not using angular material,but It works (I am using @ work). This is target to angular 6, but works in all previous version.

    Need to add JITComplierFactory for AngularVersion 5 and above.

    Thanks

    Vijay

提交回复
热议问题