I am looking for a way to dynamically add div attributes in Angular 7.
Here is what I attempted:
<div *ngFor="let e of etats._embedded.etats"
style="background: {{e.codeCouleur}} !important;"
data-code="{{e.id}}" data-bg={{e.codeCouleur}}>{{e.nom}"</div>
However, I encountered the following error:
Error: Template parse errors: Can't bind to 'code' since it isn't a known property of 'div'. (" *ngFor="let e of etats._embedded.etats" style="background: {{e.codeCouleur}} !important;" [ERROR ->]data-code="{{e.id}}" data-bg={{e.codeCouleur}}>{{e.nom}"