otter
otter copied to clipboard
[Feature]: Schematic to make a component customizable
Context
The need is to prepare a component to accept different flavors of presentation of child components. The need is similar to schematics generators for context-to-component, config-to-component
Proposal
Add a schematic which will modify the code of a given component in order to make it ready to accept the replacement of its child components.
- in component.ts file it should add the modifications according to the documentation: component.ts modif
Note: For the places where the interfaces for Context ~~and Configuration~~ of the replaceable component are asked, the generic types could be used. The developer will replace them with the good types when doing the development.
~~ex: public presenter$: Observable<Context<ContextInput, ContextOutput> & DynamicConfigurable<Configuration>>;
~~
ex: public presenter$: Observable<Context<ContextInput, ContextOutput>>;
-
in config.ts it will add the field which will drive the flavor of presentation component used ref: config.ts modif
-
in the template file a first modification can be done by the script and adjusted by the developer later ref: template modif
-
as the c11n module comes from
@o3r/components
the schematic should be done here