I am facing a situation where I have a BaseComponent and IncomingRequestsComponent that inherit from BaseComponent. To utilize templates in components that inherit from BaseComponent, I need to include them in the HTML of BaseComponent.
export class BaseTimeComponent implements OnInit, OnDestroy, AfterViewInit {
// some code
}
<ng-template #selectField let-field="fieldName" let-record="recordId">
{{fieldName}} - {{record}}
</ng-template>
For IncomingRequests:
export class IncomingRequestsComponent extends BaseComponent implements OnInit {
// some code
}
<ng-container *ngIf="field.DataType == 3">
<ng-container
[ngTemplateOutlet]="selectTemplate"
[ngTemplateOutletContext]="{ fieldName: fieldName, recordId: recordId}"
></ng-container>
</ng-container>
Despite the absence of errors, the template is not getting passed to the IncomingRequestsComponent. Is there an alternative approach to achieve this goal?