I'm trying to bind data using Angular 8 but failing miserably. One of the methods I tried is as below:
<div class="speed" style="background-image: url('http://example.com/assets/images/meter.png')" [ngStyle]="{'--p':result.percentage}"></div>
and the output:
<div _ngcontent-kyh-c1="" class="speed" style="background-image: url('http://example.com/assets/images/meter.png');" ng-reflect-ng-style="[object Object]"></div>
I want the output to be:
<div _ngcontent-kyh-c1="" class="speed" style="background-image: url('http://example.com/assets/images/meter.png');--p:24;"></div>
FYI, {{result.percentage}}
gives and an output 24
.
Please ignore _ngcontent-kyh-c1=""
which is generated by Angular 8.