UNPKG

@o3r/core

Version:
18 lines 699 B
/** * Private field where Otter component information are stored */ export const otterComponentInfoPropertyName = '__otter-info__'; /** * Decorates an Angular component to provide Otter information * @param info Information to define the Otter component * @returns the component with the information */ // eslint-disable-next-line @typescript-eslint/naming-convention -- decorator should be PascalCase export function O3rComponent(info) { return (constructor) => { const componentName = constructor.name; constructor.prototype[otterComponentInfoPropertyName] = { ...info, componentName }; return constructor; }; } //# sourceMappingURL=component-decorator.js.map