Utilizing Angular.js, I dynamically calculate the height and add the value to the CSS style attribute within an ng-repeat loop.
The issue arises with this particular line of code:
<div style="height: {{60.0 / 100.0 * (100 - (100.0 / 0.27 * (item.wert + 1.0 - 0.95)))}}%; ">
<p>{{item.wert}}</p>
</div>
By simply multiplying item.wert by a factor of 1, the calculation becomes correct. Thus, this adjusted line works as expected:
<div style="height: {{60.0 / 100.0 * (100 - (100.0 / 0.27 * ((item.wert * 1.0) + 1.0 - 0.95)))}}%; ">
<p>{{item.wert}}</p>
</div>
Could anyone shed light on why this multiplication by 1 is necessary? Thank you!