Angular 2 Passing data to component when dynamically adding the component

前端 未结 3 1237
没有蜡笔的小新
没有蜡笔的小新 2021-01-12 09:43

I have dynamically added a component on the click of a button .

Below is the code for my widget . Simple div with color property being set as input.

3条回答
  •  忘掉有多难
    2021-01-12 10:36

    I will put this article if you can't find it in google https://netbasal.com/dynamically-creating-components-with-angular-a7346f4a982d It explains perfectly how to pass data, It helps me a lot to understand the resolveComponentFactory, Sorry for the answer is more like a comment but I do not have enough reputation.

提交回复
热议问题