[ADF-5106] fix stencil registration (#5694)

* customize services on the module level

* improved service registration
This commit is contained in:
Denys Vuika
2020-05-13 19:31:49 +01:00
committed by GitHub
parent 2b7943919d
commit f6801b1997
11 changed files with 49 additions and 37 deletions

View File

@@ -67,6 +67,17 @@ export abstract class DynamicComponentMapper {
this.types[type] = resolver;
}
/**
* Register multiple components
*/
register(components: { [key: string]: DynamicComponentResolveFunction }, override: boolean = false) {
if (components) {
for (const type of Object.keys(components)) {
this.setComponentTypeResolver(type, components[type], override);
}
}
}
/**
* Finds the component type that is needed to render a form field.
* @param model Form field model for the field to render