Answer the question
In order to leave comments, you need to log in
Keep track of the value received by the class and add the class?
There is such a code, in the variable @ShoppingCartService.CurrentWishlist.Count I get a value, for example 0 and 1 depending on the button being pressed, I need to monitor this value and if it becomes greater than 0, then add some class for the span, I tried to do this
class="@(@ShoppingCartService.CurrentWishlist.Count > 0 ? " products-view-tile-element-hidden" : "")"
<div class="whish-list">
<a href="@Url.AbsoluteRouteUrl("WishList")">
<span class="@(@ShoppingCartService.CurrentWishlist.Count > 0 ? " products-view-tile-element-hidden" : "")" data-wishlist-count data-start-count="@ShoppingCartService.CurrentWishlist.Count" data-ng-bind="wishlistCount.countObj.count">
@ShoppingCartService.CurrentWishlist.Count
</span>
</a>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question