Back to home page

EIC code displayed by LXR

 
 

    


Warning, /firebird/firebird-ng/src/app/services/configurator/configurator-registry.service.ts is written in an unsupported language. File is not indexed.

0001 import { Injectable, Type } from '@angular/core';
0002 import { PainterConfig } from '../painter-config.interface';
0003 import { ConfiguratorComponent } from './configurator.component';
0004 
0005 @Injectable({ providedIn: 'root' })
0006 export class ConfiguratorRegistryService {
0007   private registry = new Map<string, Type<ConfiguratorComponent<any>>>();
0008 
0009   register<T extends PainterConfig>(
0010     configType: string,
0011     component: Type<ConfiguratorComponent<T>>
0012   ): void {
0013     this.registry.set(configType, component);
0014   }
0015 
0016   getComponent<T extends PainterConfig>(configType: string): Type<ConfiguratorComponent<T>> | undefined {
0017     return this.registry.get(configType);
0018   }
0019 }