Reputation: 61
I want to expand my element conditionally, so that on click it will expand according to height of its content.
Component's html:
<div class="container" [style.height]="enlarged === true ? '120px' : '50px'">
<div class="textContainer">
<ion-label>
Welcome </ion-label>
<ion-label>{{ content}}</ion-label>
</div>
</div>
Upvotes: 0
Views: 142
Reputation: 7119
It can be done by using auto. Such as:
[style.height]="enlarged === true ? 'auto' : '50px'"
Upvotes: 1