I want to add a class to my div if a string is larger than 10 characters, I try this but didn't work
<div class="page-heading" ngClass="{'hidden-lines':post.title.length > 10}">
You need to box it using [] so that becomes [ngClass]. This notation is used for expression binding.
<div class="page-heading" [ngClass]="{'hidden-lines':post.title.length > 10}">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With