Files
dspace-angular/src/app/shared/menu/menu-section.decorator.ts
2018-12-05 12:46:22 +01:00

17 lines
446 B
TypeScript

import { SectionType } from './initial-menus-state';
const menuSectionTypeComponentMap = new Map();
export function rendersSectionForType(type: SectionType) {
return function decorator(sectionComponent: any) {
if (!sectionComponent) {
return;
}
menuSectionTypeComponentMap.set(type, sectionComponent);
};
}
export function getComponentForSectionType(type: SectionType) {
return menuSectionTypeComponentMap.get(type);
}