2021-03-08 13:18:17 +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 { Injector, NgModule } from '@angular/core';
|
2024-03-12 15:24:54 +01:00
|
|
|
import { ROUTES, Routes } from '@angular/router';
|
2021-03-08 13:18:17 +01:00
|
|
|
|
|
|
|
import { CoreSharedModule } from '@/core/shared.module';
|
|
|
|
import { AddonBlogEntriesPage } from './pages/entries/entries';
|
|
|
|
import { CoreCommentsComponentsModule } from '@features/comments/components/components.module';
|
|
|
|
|
|
|
|
import { CoreTagComponentsModule } from '@features/tag/components/components.module';
|
|
|
|
import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module';
|
2024-03-12 15:37:00 +01:00
|
|
|
import { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants';
|
2021-10-21 15:06:45 +02:00
|
|
|
import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module';
|
2021-03-08 13:18:17 +01:00
|
|
|
|
2023-01-25 11:08:36 +01:00
|
|
|
/**
|
|
|
|
* Build module routes.
|
|
|
|
*
|
|
|
|
* @param injector Injector.
|
|
|
|
* @returns Routes.
|
|
|
|
*/
|
2021-03-08 13:18:17 +01:00
|
|
|
function buildRoutes(injector: Injector): Routes {
|
|
|
|
return [
|
|
|
|
...buildTabMainRoutes(injector, {
|
2021-06-10 14:54:36 +02:00
|
|
|
data: {
|
2024-03-12 15:37:00 +01:00
|
|
|
mainMenuTabRoot: ADDON_BLOG_MAINMENU_PAGE_NAME,
|
2021-06-10 14:54:36 +02:00
|
|
|
},
|
2021-03-08 13:18:17 +01:00
|
|
|
component: AddonBlogEntriesPage,
|
|
|
|
}),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
@NgModule({
|
|
|
|
imports: [
|
|
|
|
CoreSharedModule,
|
|
|
|
CoreCommentsComponentsModule,
|
|
|
|
CoreTagComponentsModule,
|
2021-10-21 15:06:45 +02:00
|
|
|
CoreMainMenuComponentsModule,
|
2021-03-08 13:18:17 +01:00
|
|
|
],
|
|
|
|
providers: [
|
|
|
|
{
|
|
|
|
provide: ROUTES,
|
|
|
|
multi: true,
|
|
|
|
deps: [Injector],
|
|
|
|
useFactory: buildRoutes,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
declarations: [
|
|
|
|
AddonBlogEntriesPage,
|
|
|
|
],
|
|
|
|
})
|
|
|
|
export class AddonBlogLazyModule {}
|