diff --git a/src/addons/mod/assign/assign.module.ts b/src/addons/mod/assign/assign.module.ts index 349fa9ee5..9203223a9 100644 --- a/src/addons/mod/assign/assign.module.ts +++ b/src/addons/mod/assign/assign.module.ts @@ -22,7 +22,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModAssignComponentsModule } from './components/components.module'; import { AddonModAssignFeedbackModule } from './feedback/feedback.module'; import { AddonModAssignProvider } from './services/assign'; import { OFFLINE_SITE_SCHEMA } from './services/database/assign'; @@ -57,6 +56,17 @@ export async function getModAssignServices(): Promise[]> { ]; } +/** + * Get assign component modules. + * + * @returns Assign component modules. + */ +export async function getModAssignComponentModules(): Promise { + const { AddonModAssignComponentsModule } = await import('@addons/mod/assign/components/components.module'); + + return [AddonModAssignComponentsModule]; +} + const routes: Routes = [ { path: AddonModAssignModuleHandlerService.PAGE_NAME, @@ -67,7 +77,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModAssignComponentsModule, AddonModAssignSubmissionModule, AddonModAssignFeedbackModule, ], diff --git a/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts b/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts index d24550af8..131966598 100644 --- a/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts +++ b/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts @@ -17,7 +17,6 @@ import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; -import { AddonModBBBComponentsModule } from './components/components.module'; import { AddonModBBBIndexLinkHandler } from './services/handlers/index-link'; import { AddonModBBBListLinkHandler } from './services/handlers/list-link'; import { AddonModBBBModuleHandler, ADDON_MOD_BBB_MAIN_MENU_PAGE_NAME } from './services/handlers/module'; @@ -32,7 +31,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModBBBComponentsModule, ], providers: [ { diff --git a/src/addons/mod/book/book.module.ts b/src/addons/mod/book/book.module.ts index 5514fac89..82c5f9f33 100644 --- a/src/addons/mod/book/book.module.ts +++ b/src/addons/mod/book/book.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreTagAreaDelegate } from '@features/tag/services/tag-area-delegate'; -import { AddonModBookComponentsModule } from './components/components.module'; import { AddonModBookModuleHandler, AddonModBookModuleHandlerService } from './services/handlers/module'; import { AddonModBookIndexLinkHandler } from './services/handlers/index-link'; import { AddonModBookListLinkHandler } from './services/handlers/list-link'; @@ -38,7 +37,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModBookComponentsModule, ], providers: [ { diff --git a/src/addons/mod/choice/choice.module.ts b/src/addons/mod/choice/choice.module.ts index 5d4bf37a6..dbf056f0f 100644 --- a/src/addons/mod/choice/choice.module.ts +++ b/src/addons/mod/choice/choice.module.ts @@ -22,7 +22,6 @@ import { CoreCourseModulePrefetchDelegate } from '@features/course/services/modu import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModChoiceComponentsModule } from './components/components.module'; import { AddonModChoiceProvider } from './services/choice'; import { OFFLINE_SITE_SCHEMA } from './services/database/choice'; import { AddonModChoiceIndexLinkHandler } from './services/handlers/index-link'; @@ -41,7 +40,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModChoiceComponentsModule, ], providers: [ { diff --git a/src/addons/mod/feedback/feedback.module.ts b/src/addons/mod/feedback/feedback.module.ts index 4585e8a42..a13902749 100644 --- a/src/addons/mod/feedback/feedback.module.ts +++ b/src/addons/mod/feedback/feedback.module.ts @@ -22,7 +22,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModFeedbackComponentsModule } from './components/components.module'; import { OFFLINE_SITE_SCHEMA } from './services/database/feedback'; import { AddonModFeedbackProvider } from './services/feedback'; import { AddonModFeedbackAnalysisLinkHandler } from './services/handlers/analysis-link'; @@ -47,7 +46,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModFeedbackComponentsModule, ], providers: [ { diff --git a/src/addons/mod/folder/folder.module.ts b/src/addons/mod/folder/folder.module.ts index 963ec3ebe..f27d0ddac 100644 --- a/src/addons/mod/folder/folder.module.ts +++ b/src/addons/mod/folder/folder.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; -import { AddonModFolderComponentsModule } from './components/components.module'; import { AddonModFolderIndexLinkHandler } from './services/handlers/index-link'; import { AddonModFolderListLinkHandler } from './services/handlers/list-link'; import { AddonModFolderModuleHandler, AddonModFolderModuleHandlerService } from './services/handlers/module'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModFolderComponentsModule, ], providers: [ { diff --git a/src/addons/mod/forum/forum.module.ts b/src/addons/mod/forum/forum.module.ts index 732fd1870..6c7d4479a 100644 --- a/src/addons/mod/forum/forum.module.ts +++ b/src/addons/mod/forum/forum.module.ts @@ -22,7 +22,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreScreen } from '@services/screen'; -import { AddonModForumComponentsModule } from './components/components.module'; import { AddonModForumModuleHandler, AddonModForumModuleHandlerService } from './services/handlers/module'; import { SITE_SCHEMA } from './services/database/offline'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; @@ -94,7 +93,6 @@ const courseContentsRoutes: Routes = conditionalRoutes( imports: [ CoreMainMenuTabRoutingModule.forChild(mainMenuRoutes), CoreCourseContentsRoutingModule.forChild({ children: courseContentsRoutes }), - AddonModForumComponentsModule, ], providers: [ { diff --git a/src/addons/mod/glossary/glossary.module.ts b/src/addons/mod/glossary/glossary.module.ts index 2e92a32f2..f7fe4c4f4 100644 --- a/src/addons/mod/glossary/glossary.module.ts +++ b/src/addons/mod/glossary/glossary.module.ts @@ -26,7 +26,6 @@ import { CoreTagAreaDelegate } from '@features/tag/services/tag-area-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CoreScreen } from '@services/screen'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModGlossaryComponentsModule } from './components/components.module'; import { SITE_SCHEMA, OFFLINE_SITE_SCHEMA } from './services/database/glossary'; import { AddonModGlossaryProvider } from './services/glossary'; import { AddonModGlossaryEditLinkHandler } from './services/handlers/edit-link'; @@ -86,7 +85,6 @@ const courseContentsRoutes: Routes = conditionalRoutes( imports: [ CoreMainMenuTabRoutingModule.forChild(mainMenuRoutes), CoreCourseContentsRoutingModule.forChild({ children: courseContentsRoutes }), - AddonModGlossaryComponentsModule, ], providers: [ { diff --git a/src/addons/mod/h5pactivity/h5pactivity.module.ts b/src/addons/mod/h5pactivity/h5pactivity.module.ts index 3cfc1cf59..a5a411de0 100644 --- a/src/addons/mod/h5pactivity/h5pactivity.module.ts +++ b/src/addons/mod/h5pactivity/h5pactivity.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreCronDelegate } from '@services/cron'; -import { AddonModH5PActivityComponentsModule } from './components/components.module'; import { AddonModH5PActivityIndexLinkHandler } from './services/handlers/index-link'; import { AddonModH5PActivityModuleHandler, AddonModH5PActivityModuleHandlerService } from './services/handlers/module'; import { AddonModH5PActivityPrefetchHandler } from './services/handlers/prefetch'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModH5PActivityComponentsModule, ], providers: [ { diff --git a/src/addons/mod/imscp/imscp.module.ts b/src/addons/mod/imscp/imscp.module.ts index f8930e93b..6014981a1 100644 --- a/src/addons/mod/imscp/imscp.module.ts +++ b/src/addons/mod/imscp/imscp.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; -import { AddonModImscpComponentsModule } from './components/components.module'; import { AddonModImscpIndexLinkHandler } from './services/handlers/index-link'; import { AddonModImscpListLinkHandler } from './services/handlers/list-link'; import { AddonModImscpModuleHandler, AddonModImscpModuleHandlerService } from './services/handlers/module'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModImscpComponentsModule, ], providers: [ { diff --git a/src/addons/mod/lesson/lesson.module.ts b/src/addons/mod/lesson/lesson.module.ts index fb9216ee1..dd05e9f6e 100644 --- a/src/addons/mod/lesson/lesson.module.ts +++ b/src/addons/mod/lesson/lesson.module.ts @@ -23,7 +23,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModLessonComponentsModule } from './components/components.module'; import { SITE_SCHEMA, OFFLINE_SITE_SCHEMA, SYNC_SITE_SCHEMA } from './services/database/lesson'; import { AddonModLessonGradeLinkHandler } from './services/handlers/grade-link'; import { AddonModLessonIndexLinkHandler } from './services/handlers/index-link'; @@ -45,7 +44,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModLessonComponentsModule, ], providers: [ { diff --git a/src/addons/mod/lti/lti.module.ts b/src/addons/mod/lti/lti.module.ts index 7a91fa3db..27cd783da 100644 --- a/src/addons/mod/lti/lti.module.ts +++ b/src/addons/mod/lti/lti.module.ts @@ -18,7 +18,6 @@ import { CoreContentLinksDelegate } from '@features/contentlinks/services/conten import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; -import { AddonModLtiComponentsModule } from './components/components.module'; import { AddonModLtiIndexLinkHandler } from './services/handlers/index-link'; import { AddonModLtiListLinkHandler } from './services/handlers/list-link'; import { AddonModLtiModuleHandler, AddonModLtiModuleHandlerService } from './services/handlers/module'; @@ -35,7 +34,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModLtiComponentsModule, ], providers: [ { diff --git a/src/addons/mod/page/page.module.ts b/src/addons/mod/page/page.module.ts index d356586eb..edcd8fd94 100644 --- a/src/addons/mod/page/page.module.ts +++ b/src/addons/mod/page/page.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; -import { AddonModPageComponentsModule } from './components/components.module'; import { AddonModPageIndexLinkHandler } from './services/handlers/index-link'; import { AddonModPageListLinkHandler } from './services/handlers/list-link'; import { AddonModPageModuleHandler, AddonModPageModuleHandlerService } from './services/handlers/module'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModPageComponentsModule, ], providers: [ { diff --git a/src/addons/mod/quiz/quiz.module.ts b/src/addons/mod/quiz/quiz.module.ts index 8d7f40ee5..3dbf6688e 100644 --- a/src/addons/mod/quiz/quiz.module.ts +++ b/src/addons/mod/quiz/quiz.module.ts @@ -24,7 +24,6 @@ import { CorePushNotificationsDelegate } from '@features/pushnotifications/servi import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; import { AddonModQuizAccessRulesModule } from './accessrules/accessrules.module'; -import { AddonModQuizComponentsModule } from './components/components.module'; import { SITE_SCHEMA } from './services/database/quiz'; import { AddonModQuizGradeLinkHandler } from './services/handlers/grade-link'; import { AddonModQuizIndexLinkHandler } from './services/handlers/index-link'; @@ -57,6 +56,17 @@ export async function getModQuizServices(): Promise[]> { ]; } +/** + * Get quiz component modules. + * + * @returns Quiz component modules. + */ +export async function getModQuizComponentModules(): Promise { + const { AddonModQuizComponentsModule } = await import('@addons/mod/quiz/components/components.module'); + + return [AddonModQuizComponentsModule]; +} + const routes: Routes = [ { path: AddonModQuizModuleHandlerService.PAGE_NAME, @@ -67,7 +77,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModQuizComponentsModule, AddonModQuizAccessRulesModule, ], providers: [ diff --git a/src/addons/mod/resource/resource.module.ts b/src/addons/mod/resource/resource.module.ts index 349c59a90..d27d47f95 100644 --- a/src/addons/mod/resource/resource.module.ts +++ b/src/addons/mod/resource/resource.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; -import { AddonModResourceComponentsModule } from './components/components.module'; import { AddonModResourceIndexLinkHandler } from './services/handlers/index-link'; import { AddonModResourceListLinkHandler } from './services/handlers/list-link'; import { AddonModResourceModuleHandlerService, AddonModResourceModuleHandler } from './services/handlers/module'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModResourceComponentsModule, ], providers: [ { diff --git a/src/addons/mod/scorm/scorm.module.ts b/src/addons/mod/scorm/scorm.module.ts index 643b03890..559edea16 100644 --- a/src/addons/mod/scorm/scorm.module.ts +++ b/src/addons/mod/scorm/scorm.module.ts @@ -22,7 +22,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CoreCronDelegate } from '@services/cron'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModScormComponentsModule } from './components/components.module'; import { OFFLINE_SITE_SCHEMA } from './services/database/scorm'; import { AddonModScormGradeLinkHandler } from './services/handlers/grade-link'; import { AddonModScormIndexLinkHandler } from './services/handlers/index-link'; @@ -44,7 +43,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModScormComponentsModule, ], providers: [ { diff --git a/src/addons/mod/url/url.module.ts b/src/addons/mod/url/url.module.ts index 5a354c96c..2699d006b 100644 --- a/src/addons/mod/url/url.module.ts +++ b/src/addons/mod/url/url.module.ts @@ -18,7 +18,6 @@ import { CoreContentLinksDelegate } from '@features/contentlinks/services/conten import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; -import { AddonModUrlComponentsModule } from './components/components.module'; import { AddonModUrlIndexLinkHandler } from './services/handlers/index-link'; import { AddonModUrlListLinkHandler } from './services/handlers/list-link'; import { AddonModUrlModuleHandler } from './services/handlers/module'; @@ -35,7 +34,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModUrlComponentsModule, ], providers: [ { diff --git a/src/addons/mod/wiki/wiki.module.ts b/src/addons/mod/wiki/wiki.module.ts index 18dbef296..7625d9987 100644 --- a/src/addons/mod/wiki/wiki.module.ts +++ b/src/addons/mod/wiki/wiki.module.ts @@ -22,7 +22,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CoreTagAreaDelegate } from '@features/tag/services/tag-area-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModWikiComponentsModule } from './components/components.module'; import { OFFLINE_SITE_SCHEMA } from './services/database/wiki'; import { AddonModWikiCreateLinkHandler } from './services/handlers/create-link'; import { AddonModWikiEditLinkHandler } from './services/handlers/edit-link'; @@ -45,7 +44,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModWikiComponentsModule, ], providers: [ { diff --git a/src/core/features/compile/services/compile.ts b/src/core/features/compile/services/compile.ts index 310f92da0..182cd13f4 100644 --- a/src/core/features/compile/services/compile.ts +++ b/src/core/features/compile/services/compile.ts @@ -129,8 +129,8 @@ import { getCompetencyServices } from '@addons/competency/competency.module'; import { getCourseCompletionServices } from '@addons/coursecompletion/coursecompletion.module'; import { getMessageOutputServices } from '@addons/messageoutput/messageoutput.module'; import { getMessagesServices } from '@addons/messages/messages.module'; -import { getModAssignServices } from '@addons/mod/assign/assign.module'; -import { getModQuizServices } from '@addons/mod/quiz/quiz.module'; +import { getModAssignComponentModules, getModAssignServices } from '@addons/mod/assign/assign.module'; +import { getModQuizComponentModules, getModQuizServices } from '@addons/mod/quiz/quiz.module'; import { getModWorkshopComponentModules, getModWorkshopServices } from '@addons/mod/workshop/workshop.module'; import { getNotesServices } from '@addons/notes/notes.module'; import { getNotificationsServices } from '@addons/notifications/notifications.module'; @@ -172,6 +172,8 @@ export class CoreCompileProvider { ]; protected readonly LAZY_IMPORTS = [ + getModAssignComponentModules, + getModQuizComponentModules, getModWorkshopComponentModules, ];