import {Injectable} from "@angular/core"; import {Icon} from "./icons"; @Injectable({ providedIn: 'root' }) export class IconsService { private registry = new Map(); public registerIcons(icons: any[]): void { icons.forEach((icon: Icon) => this.registry.set(icon.name, icon.data)); } public getIcon(iconName: string): string | undefined { return this.registry.get(iconName); } }