How to load the ng-template in separate file?

前端 未结 3 2212
傲寒
傲寒 2021-02-20 07:33

In below sample, I have used ng-template like below and it is working fine.

Sample link: click here

3条回答
  •  太阳男子
    2021-02-20 07:58

    You can have a component for your templates (name it tplComponent) and inside that, create as many templates as you want. Then in other components, get an instance of tplComponent and get the template from that. Here is a question that has an example of this approach (I haven't tried that though).

    Please let me know if that works.

提交回复
热议问题