matheusmurta
2/10/2020 - 4:30 PM

Angular send ng-template to component

Angular send ng-template to component

//your component 
<div *ngTemplateOutlet="template"></div> 
  @Input() template :TemplateRef<any>;
  
  
//your module 
  <ng-template #loading>
    <div>Loading...2</div>
</ng-template>

<my comp>...[template]="loading">