I am currently working on an Angular application that fetches a configuration file in .json
format. My goal is to dynamically choose components and apply inline styles to them.
Below is an example of the structure of the configuration data obtained from an HTTP request:
For instance;
var config = [
{
name: "header-component",
styles: "margin:0;padding:0;background:black"
}
]
<div *ngFor="let conf of config">
<{{conf.name}} style="{{conf.styles}}"></{{conf.name}}>
</div>
Do you have any suggestions on how I can make this work, or do you recommend an alternative approach?