Modal in diferent pages using ionc4

hi i want to use a modal in diferent pages but i am getting this error
Error: Type PrescriptionPage is part of the declarations of 2 modules: ViewOrderPageModule and ViewInvoicePageModule! Please consider moving PrescriptionPage to a higher module that imports ViewOrderPageModule and ViewInvoicePageModule. You can also create a new NgModule that exports and includes PrescriptionPage then import that NgModule in ViewOrderPageModule and ViewInvoicePageModule

can anyone know how to use modal in two different page

You need to move the modal up to it’s own module.

Create a module file for the modal component and instead of declaring the modal in the different pages, you import the module instead.

See the angular docs.

https://angular.io/guide/sharing-ngmodules

1 Like

it is working if i import my both page in app.module.ts and the prescriptionpage i need to add in declarations and entry components in app.module.ts
this is beacuse of lazy loading i am using angular 8 now issue is fixed