我创建了一个模态并将其命名为worksmodal
。
它从页面showworks
打开。一切正常。
[新要求-我也必须从Notificatons
页面打开相同的模式,因此我也从那里调用了它。
问题:现在它正在从Notifications page
打开,当我尝试从showworks page
打开时,它给出了错误-
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.
您需要注意的几件事-
当应用打开时,默认情况下会打开Dashboard page
并调用Notification popover page,然后依次调用worksmodal page
showworks page
从也叫worksmodal page
的菜单中打开。错误出现在这里
worksmodal.module.ts
禁用的十进制]
// declarations: [WorksmodalPage]
现在如果我从WorksmodalPage
的声明中删除showworks.module.ts
,它会给出错误-
WorksmodalPage is not part of any NgModule or the module has not been imported into your module.
我需要怎么做才能在两个页面上都起作用?
我创建了一个模式并将其命名为workmodal。它从页面showworks中打开。一切正常。新要求-我也必须从“通知”页面打开相同的模式,因此我从...
将模态组件的声明移到其自己的模块中,并确保将其导出到该模块中。然后将该模块导入到您正在使用它的页面中。