From 2078c12571591e3a4acd7f9740d617870d698bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 12 Mar 2024 15:37:00 +0100 Subject: [PATCH] MOBILE-3947 chore: Decouple constants from Addons used in core folder --- .../searchforums/services/block-handler.ts | 4 ++-- src/addons/blog/blog-lazy.module.ts | 4 ++-- src/addons/blog/blog.module.ts | 5 +++-- src/addons/blog/constants.ts | 15 ++++++++++++++ .../blog/services/handlers/course-option.ts | 4 ++-- src/addons/blog/services/handlers/mainmenu.ts | 5 ++--- src/addons/calendar/constants.ts | 15 ++++++++++++++ .../calendar/pages/edit-event/edit-event.ts | 7 ++++--- .../calendar/services/calendar-helper.ts | 3 ++- src/addons/calendar/services/calendar-sync.ts | 4 ++-- src/addons/calendar/services/calendar.ts | 20 +++++++++---------- .../mod/forum/components/index/index.ts | 5 ++--- src/addons/mod/forum/constants.ts | 15 ++++++++++++++ src/addons/mod/forum/forum.module.ts | 5 ++--- .../module-summary/module-summary.ts | 4 ++-- .../mainmenu/mainmenu-home-lazy.module.ts | 5 +---- .../reminders/services/database/reminders.ts | 4 ++-- src/core/features/sitehome/sitehome.module.ts | 1 - 18 files changed, 83 insertions(+), 42 deletions(-) create mode 100644 src/addons/blog/constants.ts create mode 100644 src/addons/calendar/constants.ts create mode 100644 src/addons/mod/forum/constants.ts diff --git a/src/addons/block/searchforums/services/block-handler.ts b/src/addons/block/searchforums/services/block-handler.ts index 58c27d0e1..b1425a34d 100644 --- a/src/addons/block/searchforums/services/block-handler.ts +++ b/src/addons/block/searchforums/services/block-handler.ts @@ -17,7 +17,7 @@ import { CoreBlockHandlerData } from '@features/block/services/block-delegate'; import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block'; import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler'; import { makeSingleton } from '@singletons'; -import { FORUM_SEARCH_PAGE_NAME } from '@addons/mod/forum/forum.module'; +import { ADDON_MOD_FORUM_SEARCH_PAGE_NAME } from '@addons/mod/forum/constants'; import { CoreCourseBlock } from '@features/course/services/course'; import { CoreSearchGlobalSearch } from '@features/search/services/global-search'; @@ -60,7 +60,7 @@ export class AddonBlockSearchForumsHandlerService extends CoreBlockBaseHandler { title: 'addon.block_searchforums.pluginname', class: 'addon-block-search-forums', component: CoreBlockOnlyTitleComponent, - link: FORUM_SEARCH_PAGE_NAME, + link: ADDON_MOD_FORUM_SEARCH_PAGE_NAME, linkParams: { courseId: instanceId }, }; } diff --git a/src/addons/blog/blog-lazy.module.ts b/src/addons/blog/blog-lazy.module.ts index 5eea47053..4ee04963b 100644 --- a/src/addons/blog/blog-lazy.module.ts +++ b/src/addons/blog/blog-lazy.module.ts @@ -21,7 +21,7 @@ import { CoreCommentsComponentsModule } from '@features/comments/components/comp import { CoreTagComponentsModule } from '@features/tag/components/components.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; -import { AddonBlogMainMenuHandlerService } from './services/handlers/mainmenu'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants'; import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module'; /** @@ -34,7 +34,7 @@ function buildRoutes(injector: Injector): Routes { return [ ...buildTabMainRoutes(injector, { data: { - mainMenuTabRoot: AddonBlogMainMenuHandlerService.PAGE_NAME, + mainMenuTabRoot: ADDON_BLOG_MAINMENU_PAGE_NAME, }, component: AddonBlogEntriesPage, }), diff --git a/src/addons/blog/blog.module.ts b/src/addons/blog/blog.module.ts index fca1d2bb5..b2dbfdde1 100644 --- a/src/addons/blog/blog.module.ts +++ b/src/addons/blog/blog.module.ts @@ -24,13 +24,14 @@ import { CoreTagAreaDelegate } from '@features/tag/services/tag-area-delegate'; import { CoreUserDelegate } from '@features/user/services/user-delegate'; import { AddonBlogCourseOptionHandler } from './services/handlers/course-option'; import { AddonBlogIndexLinkHandler } from './services/handlers/index-link'; -import { AddonBlogMainMenuHandler, AddonBlogMainMenuHandlerService } from './services/handlers/mainmenu'; +import { AddonBlogMainMenuHandler } from './services/handlers/mainmenu'; import { AddonBlogTagAreaHandler } from './services/handlers/tag-area'; import { AddonBlogUserHandler } from './services/handlers/user'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants'; const routes: Routes = [ { - path: AddonBlogMainMenuHandlerService.PAGE_NAME, + path: ADDON_BLOG_MAINMENU_PAGE_NAME, loadChildren: () => import('@addons/blog/blog-lazy.module').then(m => m.AddonBlogLazyModule), }, ]; diff --git a/src/addons/blog/constants.ts b/src/addons/blog/constants.ts new file mode 100644 index 000000000..572cd8f9e --- /dev/null +++ b/src/addons/blog/constants.ts @@ -0,0 +1,15 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export const ADDON_BLOG_MAINMENU_PAGE_NAME = 'blog'; diff --git a/src/addons/blog/services/handlers/course-option.ts b/src/addons/blog/services/handlers/course-option.ts index e9bf4fe7e..9a996d903 100644 --- a/src/addons/blog/services/handlers/course-option.ts +++ b/src/addons/blog/services/handlers/course-option.ts @@ -26,7 +26,7 @@ import { CoreSites } from '@services/sites'; import { CoreWSFile } from '@services/ws'; import { makeSingleton } from '@singletons'; import { AddonBlog } from '../blog'; -import { AddonBlogMainMenuHandlerService } from './mainmenu'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from '@addons/blog/constants'; /** * Course nav handler. @@ -75,7 +75,7 @@ export class AddonBlogCourseOptionHandlerService implements CoreCourseOptionsHan return { title: 'addon.blog.blog', class: 'addon-blog-handler', - page: AddonBlogMainMenuHandlerService.PAGE_NAME, + page: ADDON_BLOG_MAINMENU_PAGE_NAME, }; } diff --git a/src/addons/blog/services/handlers/mainmenu.ts b/src/addons/blog/services/handlers/mainmenu.ts index 142a3d679..eb99ca346 100644 --- a/src/addons/blog/services/handlers/mainmenu.ts +++ b/src/addons/blog/services/handlers/mainmenu.ts @@ -16,6 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '@features/mainmenu/services/mainmenu-delegate'; import { makeSingleton } from '@singletons'; import { AddonBlog } from '../blog'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from '@addons/blog/constants'; /** * Handler to inject an option into main menu. @@ -23,8 +24,6 @@ import { AddonBlog } from '../blog'; @Injectable({ providedIn: 'root' }) export class AddonBlogMainMenuHandlerService implements CoreMainMenuHandler { - static readonly PAGE_NAME = 'blog'; - name = 'AddonBlog'; priority = 500; @@ -42,7 +41,7 @@ export class AddonBlogMainMenuHandlerService implements CoreMainMenuHandler { return { icon: 'far-newspaper', title: 'addon.blog.siteblogheading', - page: AddonBlogMainMenuHandlerService.PAGE_NAME, + page: ADDON_BLOG_MAINMENU_PAGE_NAME, class: 'addon-blog-handler', }; } diff --git a/src/addons/calendar/constants.ts b/src/addons/calendar/constants.ts new file mode 100644 index 000000000..d4632c2b8 --- /dev/null +++ b/src/addons/calendar/constants.ts @@ -0,0 +1,15 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export const ADDON_CALENDAR_COMPONENT = 'AddonCalendarEvents'; diff --git a/src/addons/calendar/pages/edit-event/edit-event.ts b/src/addons/calendar/pages/edit-event/edit-event.ts index 653aa35b9..f95dec762 100644 --- a/src/addons/calendar/pages/edit-event/edit-event.ts +++ b/src/addons/calendar/pages/edit-event/edit-event.ts @@ -45,6 +45,7 @@ import { CoreForms } from '@singletons/form'; import { CoreReminders, CoreRemindersService, CoreRemindersUnits } from '@features/reminders/services/reminders'; import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/components/set-reminder-menu/set-reminder-menu'; import moment from 'moment-timezone'; +import { ADDON_CALENDAR_COMPONENT } from '@addons/calendar/constants'; /** * Page that displays a form to create/edit an event. @@ -60,7 +61,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { @ViewChild('editEventForm') formElement!: ElementRef; title = 'addon.calendar.newevent'; - component = AddonCalendarProvider.COMPONENT; + component = ADDON_CALENDAR_COMPONENT; loaded = false; hasOffline = false; eventTypes: AddonCalendarEventTypeOption[] = []; @@ -179,7 +180,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { promises.push(AddonCalendarSync.waitForSync(AddonCalendarSyncProvider.SYNC_ID).then(async () => { // Do not block if the scope is already destroyed. if (!this.isDestroyed && this.eventId) { - CoreSync.blockOperation(AddonCalendarProvider.COMPONENT, eventId); + CoreSync.blockOperation(ADDON_CALENDAR_COMPONENT, eventId); } let eventForm: AddonCalendarEvent | AddonCalendarOfflineEventDBRecord | undefined; @@ -597,7 +598,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { */ protected unblockSync(): void { if (this.eventId) { - CoreSync.unblockOperation(AddonCalendarProvider.COMPONENT, this.eventId); + CoreSync.unblockOperation(ADDON_CALENDAR_COMPONENT, this.eventId); } } diff --git a/src/addons/calendar/services/calendar-helper.ts b/src/addons/calendar/services/calendar-helper.ts index ca154b7ee..be7426e56 100644 --- a/src/addons/calendar/services/calendar-helper.ts +++ b/src/addons/calendar/services/calendar-helper.ts @@ -38,6 +38,7 @@ import { CoreCategoryData } from '@features/courses/services/courses'; import { CoreTimeUtils } from '@services/utils/time'; import { CoreReminders, CoreRemindersService } from '@features/reminders/services/reminders'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; +import { ADDON_CALENDAR_COMPONENT } from '../constants'; /** * Context levels enumeration. @@ -330,7 +331,7 @@ export class AddonCalendarHelperProvider { const reminders = await CoreReminders.getReminders( { instanceId: eventId, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId, ); diff --git a/src/addons/calendar/services/calendar-sync.ts b/src/addons/calendar/services/calendar-sync.ts index cc9cb00b0..bad6607d5 100644 --- a/src/addons/calendar/services/calendar-sync.ts +++ b/src/addons/calendar/services/calendar-sync.ts @@ -21,7 +21,6 @@ import { CoreUtils } from '@services/utils/utils'; import { AddonCalendar, AddonCalendarEvent, - AddonCalendarProvider, AddonCalendarSubmitCreateUpdateFormDataWSParams, } from './calendar'; import { AddonCalendarOffline } from './calendar-offline'; @@ -30,6 +29,7 @@ import { makeSingleton, Translate } from '@singletons'; import { CoreSync, CoreSyncResult } from '@services/sync'; import { CoreNetworkError } from '@classes/errors/network-error'; import moment from 'moment-timezone'; +import { ADDON_CALENDAR_COMPONENT } from '../constants'; /** * Service to sync calendar. @@ -173,7 +173,7 @@ export class AddonCalendarSyncProvider extends CoreSyncBaseProvider { // Verify that event isn't blocked. - if (CoreSync.isBlocked(AddonCalendarProvider.COMPONENT, eventId, siteId)) { + if (CoreSync.isBlocked(ADDON_CALENDAR_COMPONENT, eventId, siteId)) { this.logger.debug('Cannot sync event ' + eventId + ' because it is blocked.'); throw new CoreSyncBlockedError(Translate.instant( diff --git a/src/addons/calendar/services/calendar.ts b/src/addons/calendar/services/calendar.ts index 9bafd3be7..97c601cfb 100644 --- a/src/addons/calendar/services/calendar.ts +++ b/src/addons/calendar/services/calendar.ts @@ -51,6 +51,7 @@ import { import { CoreReminderDBRecord } from '@features/reminders/services/database/reminders'; import { CoreEvents } from '@singletons/events'; import { CoreSiteWSPreSets } from '@classes/sites/authenticated-site'; +import { ADDON_CALENDAR_COMPONENT } from '../constants'; const ROOT_CACHE_KEY = 'mmaCalendar:'; @@ -103,7 +104,6 @@ declare module '@singletons/events' { export class AddonCalendarProvider { static readonly DAYS_INTERVAL = 30; - static readonly COMPONENT = 'AddonCalendarEvents'; static readonly STARTING_WEEK_DAY = 'addon_calendar_starting_week_day'; static readonly NEW_EVENT_EVENT = 'addon_calendar_new_event'; @@ -279,7 +279,7 @@ export class AddonCalendarProvider { )); promises.push(CoreReminders.removeReminders({ instanceId: eventId, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, } , siteId)); await CoreUtils.ignoreErrors(Promise.all(promises)); @@ -292,7 +292,7 @@ export class AddonCalendarProvider { */ async initialize(): Promise { CoreLocalNotifications.registerClick( - AddonCalendarProvider.COMPONENT, + ADDON_CALENDAR_COMPONENT, async (notification) => { await ApplicationInit.donePromise; @@ -740,7 +740,7 @@ export class AddonCalendarProvider { const previousReminders = await CoreReminders.getReminders({ instanceId: event.id, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId); if (previousReminders.some((reminder) => reminder.timebefore === timebefore)) { @@ -753,7 +753,7 @@ export class AddonCalendarProvider { : ''; const reminder: CoreReminderData = { - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, instanceId: event.id, type: event.eventtype, time: event.timestart, @@ -887,7 +887,7 @@ export class AddonCalendarProvider { async getEventReminders(eventId: number, siteId?: string): Promise { return CoreReminders.getReminders({ instanceId: eventId, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId); } @@ -1448,12 +1448,12 @@ export class AddonCalendarProvider { // The event has already started, don't schedule it. // @TODO Decide when to completelly remove expired events. - return CoreReminders.cancelReminder(event.id, AddonCalendarProvider.COMPONENT, siteId); + return CoreReminders.cancelReminder(event.id, ADDON_CALENDAR_COMPONENT, siteId); } const reminders = await CoreReminders.getReminders({ instanceId: event.id, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId); await Promise.all(reminders.map(async (reminder) => { @@ -1572,7 +1572,7 @@ export class AddonCalendarProvider { const reminders = await CoreReminders.getReminders({ instanceId: event.id, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId); if (reminders.length > 0) { @@ -1725,7 +1725,7 @@ export class AddonCalendarProvider { { instanceId: result.event.id }, { instanceId: eventId, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId, ), diff --git a/src/addons/mod/forum/components/index/index.ts b/src/addons/mod/forum/components/index/index.ts index eb52118e8..f3fd74957 100644 --- a/src/addons/mod/forum/components/index/index.ts +++ b/src/addons/mod/forum/components/index/index.ts @@ -58,8 +58,7 @@ import { CoreListItemsManager } from '@classes/items-management/list-items-manag import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/routed-items-manager-sources-tracker'; import { CorePromisedValue } from '@classes/promised-value'; import { CoreNavigator } from '@services/navigator'; -import { FORUM_SEARCH_PAGE_NAME } from '@addons/mod/forum/forum.module'; - +import { ADDON_MOD_FORUM_SEARCH_PAGE_NAME } from '@addons/mod/forum/constants'; /** * Component that displays a forum entry page. */ @@ -342,7 +341,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom return; } - await CoreNavigator.navigateToSitePath(FORUM_SEARCH_PAGE_NAME, { + await CoreNavigator.navigateToSitePath(ADDON_MOD_FORUM_SEARCH_PAGE_NAME, { params: { courseId: this.courseId, forumId: this.forum.id, diff --git a/src/addons/mod/forum/constants.ts b/src/addons/mod/forum/constants.ts new file mode 100644 index 000000000..e238a9e5f --- /dev/null +++ b/src/addons/mod/forum/constants.ts @@ -0,0 +1,15 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export const ADDON_MOD_FORUM_SEARCH_PAGE_NAME = 'forum/search'; diff --git a/src/addons/mod/forum/forum.module.ts b/src/addons/mod/forum/forum.module.ts index 321aecb6a..0531275cc 100644 --- a/src/addons/mod/forum/forum.module.ts +++ b/src/addons/mod/forum/forum.module.ts @@ -41,6 +41,7 @@ import { AddonModForumPushClickHandler } from './services/handlers/push-click'; import { AddonModForumProvider } from './services/forum'; import { COURSE_CONTENTS_PATH } from '@features/course/course.module'; import { CoreCourseHelper } from '@features/course/services/course-helper'; +import { ADDON_MOD_FORUM_SEARCH_PAGE_NAME } from './constants'; /** * Get mod Forum services. @@ -61,11 +62,9 @@ export async function getModForumServices(): Promise[]> { ]; } -export const FORUM_SEARCH_PAGE_NAME = 'forum/search'; - const mainMenuRoutes: Routes = [ { - path: FORUM_SEARCH_PAGE_NAME, + path: ADDON_MOD_FORUM_SEARCH_PAGE_NAME, loadChildren: () => import('./forum-search-lazy.module').then(m => m.AddonModForumSearchLazyModule), }, { diff --git a/src/core/features/course/components/module-summary/module-summary.ts b/src/core/features/course/components/module-summary/module-summary.ts index e4f219605..42d3b28b0 100644 --- a/src/core/features/course/components/module-summary/module-summary.ts +++ b/src/core/features/course/components/module-summary/module-summary.ts @@ -14,7 +14,7 @@ import { CoreConstants, DownloadStatus } from '@/core/constants'; import { AddonBlog } from '@addons/blog/services/blog'; -import { AddonBlogMainMenuHandlerService } from '@addons/blog/services/handlers/mainmenu'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from '@addons/blog/constants'; import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { Params } from '@angular/router'; import { CoreCourse } from '@features/course/services/course'; @@ -238,7 +238,7 @@ export class CoreCourseModuleSummaryComponent implements OnInit, OnDestroy { async gotoBlog(): Promise { const params: Params = { cmId: this.moduleId }; - await CoreNavigator.navigateToSitePath(AddonBlogMainMenuHandlerService.PAGE_NAME, { params }); + await CoreNavigator.navigateToSitePath(ADDON_BLOG_MAINMENU_PAGE_NAME, { params }); } /** diff --git a/src/core/features/mainmenu/mainmenu-home-lazy.module.ts b/src/core/features/mainmenu/mainmenu-home-lazy.module.ts index c84e2b91a..99d14e33d 100644 --- a/src/core/features/mainmenu/mainmenu-home-lazy.module.ts +++ b/src/core/features/mainmenu/mainmenu-home-lazy.module.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { CoreSharedModule } from '@/core/shared.module'; @@ -56,8 +56,5 @@ function buildRoutes(injector: Injector): Routes { declarations: [ CoreMainMenuHomePage, ], - exports: [ - RouterModule, - ], }) export class CoreMainMenuHomeLazyModule {} diff --git a/src/core/features/reminders/services/database/reminders.ts b/src/core/features/reminders/services/database/reminders.ts index 6d2713f36..00427ef0b 100644 --- a/src/core/features/reminders/services/database/reminders.ts +++ b/src/core/features/reminders/services/database/reminders.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AddonCalendarProvider } from '@addons/calendar/services/calendar'; +import { ADDON_CALENDAR_COMPONENT } from '@addons/calendar/constants'; import { AddonCalendarEventDBRecord, EVENTS_TABLE } from '@addons/calendar/services/database/calendar'; import { SQLiteDB } from '@classes/sqlitedb'; import { CoreSiteSchema } from '@services/sites'; @@ -194,7 +194,7 @@ const createReminder = async ( reminderTime: number, ): Promise => { const reminder: CoreReminderData = { - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, instanceId: event.id, type: event.eventtype, timebefore: reminderTime, diff --git a/src/core/features/sitehome/sitehome.module.ts b/src/core/features/sitehome/sitehome.module.ts index 8000557c2..c968d4625 100644 --- a/src/core/features/sitehome/sitehome.module.ts +++ b/src/core/features/sitehome/sitehome.module.ts @@ -43,7 +43,6 @@ const mainMenuHomeRoutes: Routes = [ @NgModule({ imports: [CoreMainMenuHomeRoutingModule.forChild({ children: mainMenuHomeRoutes })], - exports: [CoreMainMenuHomeRoutingModule], providers: [ { provide: APP_INITIALIZER,