I am trying to hide a span if the context of the span is empty. However, the content of the span is some complicated calculation. What I want to do, is exactly below, however, I do not want to call the function twice. The element below is also in a "Loop" (ASP.NET MVC foreach in the razor page :( ).
Here is is
@for(...) {
<span ng-hide="GetDataCount() > 0">{{GetDataCount()}}</span>
}
As you can see, this will work, but I have to call the function 2 times. Any ideas how I can make this work if the "span" element we're currently in doesn't have a value? (i.e. if GetDataCount returns null or 0).
Thanks!