mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
#150 Initial grid/list view implementation
This commit is contained in:
16
src/app/object-grid/grid-element-decorator.ts
Normal file
16
src/app/object-grid/grid-element-decorator.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { GenericConstructor } from '../core/shared/generic-constructor';
|
||||
import { ListableObject } from '../object-collection/shared/listable-object.model';
|
||||
|
||||
const gridElementMap = new Map();
|
||||
export function gridElementFor(gridable: GenericConstructor<ListableObject>) {
|
||||
return function decorator(objectElement: any) {
|
||||
if (!objectElement) {
|
||||
return;
|
||||
}
|
||||
gridElementMap.set(gridable, objectElement);
|
||||
};
|
||||
}
|
||||
|
||||
export function getGridElementFor(gridable: GenericConstructor<ListableObject>) {
|
||||
return gridElementMap.get(gridable);
|
||||
}
|
Reference in New Issue
Block a user