lib/common/src/home/home.module.ts
Static forChild | ||||||
forChild(entries: ProductOrFactory<Action>[])
|
||||||
Defined in lib/common/src/home/home.module.ts:64
|
||||||
Parameters :
Returns :
ModuleWithProviders<HomePageModule>
|
import {
NgModule,
Component,
ModuleWithProviders
} from '@angular/core'
import { RouterModule } from '@angular/router'
import {
MainMenuModule,
provideMainMenuEntry
} from '../main-menu'
import { TranslationsModule } from '../translations'
import { SharedModule } from '../shared-module'
import { NotificationModule } from '../notifications'
import { ProductOrFactory } from '../interfaces'
import { Action } from '../actions'
import {
provideHomePageEntry
} from './home.commons'
import { HomePageComponent } from './home.page'
import de from './i18n/de.json'
import en from './i18n/en.json'
import { isMainThread } from 'worker_threads'
const routes = [
{ path: '', component: HomePageComponent },
]
export class MenuEntryHomeComponent {}
const menuEntry = {
position: 1,
label: "HOMEPAGE.MENU_ENTRY",
icon: "home",
path: "/",
}
@NgModule({
imports: [
RouterModule.forChild(routes),
MainMenuModule,
NotificationModule.forChild(),
SharedModule,
TranslationsModule.forChild("HOMEPAGE", {en,de})
],
providers: [
provideMainMenuEntry(menuEntry),
],
declarations: [
HomePageComponent,
],
})
export class HomePageModule {
/**
* @deprecated
*
*/
static forChild(entries: ProductOrFactory<Action>[]): ModuleWithProviders<HomePageModule>{
console.warn("HomePageModule#forChild() is deprecated; please use provideHomePageEntry instead.")
return {
ngModule: HomePageModule,
providers: [
...entries.map(provideHomePageEntry),
]
}
}
}