app.component.html:
<div
<span >{{item.name}}</span>
</div>
if item.name character was more than 300 then the height of that should be 100px. else 50px.
CodePudding user response:
Try this :
<div >
<span [style.height]='item.name.length > 300 ? "100px" : "50px"'>{{item.name}}</span>
</div>