i'm not able to set the height of Div element dynamically using Angular 4 typescript..
Thanks in Advance
Join Stack Overflow to learn, share knowledge, and build your career.
i'm not able to set the height of Div element dynamically using Angular 4 typescript..
Thanks in Advance
Use a variable which has the height you want to enter... then use [ngStyle]="{'height': [yourVariableName]}"
And for div add [class] = "ifSomething ? 'class1' : 'class2'"
It can be done by using [style.height] as follow:
//shouldExpand is a condition, you can replace it with your condition
<div class="yourClass"
[style.height]="shouldExpand === true ? '100px' : '70px'">