In below sample, I have used ng-template
like below and it is working fine.
Sample link: click here
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.