Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

Using 1 Modal from 2 pages - error - Ionic 4

$
0
0

@ersaurabh101 wrote:

I created a modal and named it worksmodal .

It opens from page showworks . Everything works fine.

New requirement - I had to open the same modal from Notificatons page as well, so I called it from there too.

Problem: Now it is opening from Notifications page , when I try to open from showworks page , it gives error-

WorksmodalPage is part of the declarations of 2 modules: NotificationsPageModule and ShowworksPageModule! Please consider moving WorksmodalPage to a higher module that imports NotificationsPageModule and ShowworksPageModule.

Few things for you to note -

  1. When app opens, by Default Dashboard page opens and it calls Notification popover page ,which in turn calls worksmodal page
  2. showworks page is opened from menu which also calls worksmodal page . Error comes here
  3. Disabled decalaration from worksmodal.module.ts

// declarations: [WorksmodalPage]

Now if I remove WorksmodalPage from Declaration of showworks.module.ts , it gives error-

WorksmodalPage is not part of any NgModule or the module has not been imported into your module.

What do I need to do so it works from both pages ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>