I need to show/hide label if length(description) < one row. Code is working ok, but if length < one row, label isn't hide. How to hide/show label?
If [[ demandAd.description ]] less than one line or less than one row(or length < 100), I need to hide label because it doesn't have a function at that time
<div class="demand">
<p class="demand-ad-time">[[demandAd.createdAt | date:"dd.MM.yyyy."]]</p>
<input type="checkbox" class="read-more-state" id="demandAd[[ demandAd.id ]]" />
<p>[[ demandAd.description ]]</p>
<label for="demandAd[[ demandAd.id ]]" class="read-more-trigger"></label>
<hr>
<div class="demand-chips">
<div class="demand-chip" ng-repeat="demandAdLabel in demandAd.labelsWithPlaces track by $index">[[ demandAdLabel ]]</div>
</div>
Hope I understand correctly, you want to hide a label when the text length is shorter than 100. You can compare the text length within
ng-hide
Here is a live sample code:
https://plnkr.co/edit/vHVXyNCTzPiuVwq2fyOG?p=preview