Merge pull request #3348 from alfonso-salces/MOBILE-4081
MOBILE-4081 courses: Load 'my.module' from servicemain
commit
eb632cc9e4
|
@ -15,6 +15,7 @@
|
|||
import { Injector, NgModule } from '@angular/core';
|
||||
import { RouterModule, ROUTES, Routes } from '@angular/router';
|
||||
import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module';
|
||||
import { CoreCoursesHelper } from './services/courses-helper';
|
||||
import { CoreCoursesMyCoursesMainMenuHandlerService } from './services/handlers/my-courses-mainmenu';
|
||||
|
||||
function buildRoutes(injector: Injector): Routes {
|
||||
|
@ -24,7 +25,7 @@ function buildRoutes(injector: Injector): Routes {
|
|||
data: {
|
||||
mainMenuTabRoot: CoreCoursesMyCoursesMainMenuHandlerService.PAGE_NAME,
|
||||
},
|
||||
loadChildren: () => import('./pages/my/my.module').then(m => m.CoreCoursesMyCoursesPageModule),
|
||||
loadChildren: () => CoreCoursesHelper.getMyRouteModule(),
|
||||
},
|
||||
{
|
||||
path: 'categories',
|
||||
|
|
|
@ -339,6 +339,15 @@ export class CoreCoursesHelperProvider {
|
|||
return startDate > Date.now();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves my courses page module.
|
||||
*
|
||||
* @returns My courses page module.
|
||||
*/
|
||||
async getMyRouteModule(): Promise<unknown> {
|
||||
return import('../pages/my/my.module').then(m => m.CoreCoursesMyCoursesPageModule);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const CoreCoursesHelper = makeSingleton(CoreCoursesHelperProvider);
|
||||
|
|
Loading…
Reference in New Issue