angular2 how to use ng-template from a different file? When I place the ng-template within the same HTML where I use it works but when I move ng-template into a separate file then it won't work. Is there a way to move ng-template into its own file and use it in different html file?
info-message.html
<ng-template #messageTemplate>
Hi
</ng-template>
<ng-container *ngTemplateOutlet="messageTemplate;"></ng-container>
above is working fine because ng-template and the usage is in same file
message-template.html
<ng-template #messageTemplate>
Hi
</ng-template>
info-message.html
<ng-container *ngTemplateOutlet="messageTemplate;"></ng-container>
This is not working. Is there a way to use "messageTemplate" which is in a separate file inside another html(Eg: info-message.html)
Thanks in advance.