Skip to content

ConfigRegistry

Tim Rücker edited this page Dec 8, 2018 · 1 revision

The ConfigRegistry class allows you to override the default values ​​of a class attribute that has been decorated using the ElementAttribute decorator.

The configuration of the global override must be at the beginning of the script (at least over the ComponentFactory.registerComponents method), since the values ​​are not accepted otherwise.

Class Members

A brief list of all class members with purposes.

public static setConfig(name: string, value: any)

Sets the config value of any configuration.

A naming recommendation of the configurations is the following:

component.{component-name or component-selector}.{property-name}

Since this is a global ConfigRegistry, it is recommended to prefix the configurations with component, since it may be that the configuration register will be used for other parts of the framework in the future.

public static getConfig(name: string, defaultValue: any = null): any

Returns the configuration values currently stored for the given config name or returns the defaultValue if no config was found. This method is normally just used by the ElementAttribute decorator, but feel free to use it.