How to dynamically add a cloned node in angular2 (equivalent to cloneNode)

前端 未结 1 1914
生来不讨喜
生来不讨喜 2021-01-14 08:14

In Angular2, I need to duplicate a node rather than moving it in some cases. That node has angular2 properties so cloneNode doesn\'t work. How can I do it?

*what doe

1条回答
  •  半阙折子戏
    2021-01-14 08:53

    Let's use the following markup for illustration:

    Paragraph One

    Paragraph Two

    Paragraph Three

    Option 1 - Manually wrap the element to clone inside a