Reputation: 1169
I want to calculate div
height based on the component value by using calc
CSS function. The error it gave me:
TypeError: co.calc is not a function
My code:
<div [ngStyle]="{'height': calc(100% - + assetScreenSize + px)}">
</div>
Upvotes: 11
Views: 7072
Reputation: 9662
Your syntax is incorrect. The correct way would be:
<div [ngStyle]="{'height': 'calc(100% -' + assetScreenSize + 'px)'}">
</div>
Upvotes: 10