I have table that is populating a list using angularjs controller. How can I show a place holder(say a dash sign) if the place expression is null or undefined??
Here is a snippet.
I am populating the view as:
<td>{{trans.Status}}</td>
<td>{{trans.PaymentId}}</td>
<td>{{trans.TransId}}</td>
I found about ng-show
in angular docs. But I really don't want to use an extra span under td
as this
<span class="empty" ng-show="!trans.TransId">N/A</span>
Is there any better way to do this.
You can do the following:
<td>{{trans.Status}}</td>
<td>{{trans.PaymentId}}</td>
<td>{{trans.TransId || 'N\A'}}</td>
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