Module to be shared
exports: [ PatientClinicalTabComponent ],
which is having a emitter patient id
Module to be Imported imports: [ PatientModule ]
Html Page
<ng-template ngbNavContent>
<app-patient-clinical-tab [patientId]='patientId'>
</app-patient-clinical-tab>
</ng-template>
But it showing error when the project is build
Error: projects/order/src/app/order-create-edit-tab/order-create-edit-tab.component.html:149:11 - error NG8001: 'app-patient-clinical-tab' is not a known element:
- If 'app-patient-clinical-tab' is an Angular component, then verify that it is part of this module.
- If 'app-patient-clinical-tab' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
149 <app-patient-clinical-tab [patientId]='patientId'> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
projects/order/src/app/order-create-edit-tab/order-create-edit-tab.component.ts:15:16 15 templateUrl: './order-create-edit-tab.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component OrderCreateEditTabComponent.
Error: projects/order/src/app/order-create-edit-tab/order-create-edit-tab.component.html:149:37 - error NG8002: Can't bind to 'patientId' since it isn't a known property of 'app-patient-clinical-tab'.
- If 'app-patient-clinical-tab' is an Angular component and it has 'patientId' input, then verify that it is part of this module.
- If 'app-patient-clinical-tab' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
- To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.m
149 <app-patient-clinical-tab [patientId]='patientId'> ~~~~~~~~~~~~~~~~~~~~~~~
projects/order/src/app/order-create-edit-tab/order-create-edit-tab.component.ts:15:16 15 templateUrl: './order-create-edit-tab.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component OrderCreateEditTabComponent
CodePudding user response:
you have to options:
- declare
PatientClinicalTabComponent
inPatientModule
(and nowhere else). Just use it insidePatientModule
- create e new module called
PatientClinicalTabModule
. DeclarePatientClinicalTabComponent
insidePatientClinicalTabModule
and then importPatientClinicalTabModule
insidePatientModule
this will solve your problem