Issue
I dont want to show the price if it's value is 0, only show the name and nothing in price then ! If its greater than 0 then it should show both name and price.
How to do that?
<tr>
<td>{{cars.name}}</td>
<td>{{cars.price}}</td>
</tr>
Solution
<tr>
<td> {{cars.name}} </td>
<td><div ng-show="cars.price > 0"> {{cars.price}} </div></td>
</tr>
Edit: if ng-show
is evaluated to false it will hide the element by applying display:none;
to the element style.
you can also use ng-if
which will not render the element at all
Answered By - Vamsi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.