mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 14:33:03 +00:00
add dynamic menu components to ENTRY_COMPONENTS
This commit is contained in:

committed by
Giuseppe Digilio

parent
0308c8bc8e
commit
8df117f8ef
@@ -14,6 +14,12 @@ const effects = [
|
||||
NavbarEffects
|
||||
];
|
||||
|
||||
const ENTRY_COMPONENTS = [
|
||||
// put only entry components that use custom decorator
|
||||
NavbarSectionComponent,
|
||||
ExpandableNavbarSectionComponent,
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
@@ -44,4 +50,15 @@ const effects = [
|
||||
* This module handles all components and pipes that are necessary for the horizontal navigation bar
|
||||
*/
|
||||
export class NavbarModule {
|
||||
/**
|
||||
* NOTE: this method allows to resolve issue with components that using a custom decorator
|
||||
* which are not loaded during CSR otherwise
|
||||
*/
|
||||
static withEntryComponents() {
|
||||
return {
|
||||
ngModule: NavbarModule,
|
||||
providers: ENTRY_COMPONENTS.map((component) => ({provide: component}))
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user