Vmeda.Online/src/core/features/grades/grades-lazy.module.ts

89 lines
2.5 KiB
TypeScript
Raw Normal View History

2021-01-26 18:30:00 +01:00
// (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.
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
2021-02-09 17:04:04 +01:00
import { conditionalRoutes } from '@/app/app-routing.module';
2021-01-26 18:30:00 +01:00
import { CoreScreen } from '@services/screen';
2021-02-09 17:04:04 +01:00
import { CoreSharedModule } from '@/core/shared.module';
2021-01-26 18:30:00 +01:00
2021-02-09 17:04:04 +01:00
import { CoreGradesCoursePage } from './pages/course/course.page';
import { CoreGradesCoursePageModule } from './pages/course/course.module';
import { CoreGradesCoursesPage } from './pages/courses/courses.page';
import { CoreGradesGradePage } from './pages/grade/grade.page';
import { CoreGradesUserHandlerService } from './services/handlers/user';
2021-01-26 18:30:00 +01:00
const mobileRoutes: Routes = [
{
path: '',
data: {
mainMenuTabRoot: CoreGradesUserHandlerService.PAGE_NAME,
},
2021-01-26 18:30:00 +01:00
component: CoreGradesCoursesPage,
},
{
path: ':courseId',
component: CoreGradesCoursePage,
},
{
path: ':courseId/:gradeId',
component: CoreGradesGradePage,
},
];
const tabletRoutes: Routes = [
{
path: '',
data: {
mainMenuTabRoot: CoreGradesUserHandlerService.PAGE_NAME,
},
2021-01-26 18:30:00 +01:00
component: CoreGradesCoursesPage,
children: [
{
path: ':courseId',
component: CoreGradesCoursePage,
},
],
},
{
path: ':courseId',
component: CoreGradesCoursePage,
children: [
{
path: ':gradeId',
component: CoreGradesGradePage,
},
],
},
];
const routes: Routes = [
...conditionalRoutes(mobileRoutes, () => CoreScreen.isMobile),
...conditionalRoutes(tabletRoutes, () => CoreScreen.isTablet),
2021-01-26 18:30:00 +01:00
];
@NgModule({
imports: [
RouterModule.forChild(routes),
CoreSharedModule,
2021-02-09 17:04:04 +01:00
CoreGradesCoursePageModule,
2021-01-26 18:30:00 +01:00
],
declarations: [
CoreGradesCoursesPage,
CoreGradesGradePage,
],
})
export class CoreGradesLazyModule {}