I have a list of sections displaying product information. The basic information is the same, but certain fields are displayed or hidden (via ng-show / ng-hide) for a specific type of product. This works great, but we want to show strings in alternating styles (zebra stripes) for readability. How can this be done, because if I hide one line, we get two lines with the same style? HTML has the form:
<div style="alt-1">
<div class="col-md-3 list-item-odd">Location</div>
<div class="col-md-9 list-item-odd" >{{ location }}</div>
</div>
<div ng-show="itemType == 1" style="alt-2">
<div class="col-md-3 list-item-odd">Layout Type</div>
<div class="col-md-9 list-item-odd" >{{ layoutType}}</div>
</div>
<div style="alt-1">
<div class="col-md-3 list-item-odd">Category</div>
<div class="col-md-9 list-item-odd" >{{ category }}</div>
</div>
As shown in this example, if itemType! = 1, we end with two adjacent lines with the style "alt-1".
One of my ideas was to write a directive (alternative styles in the example below) with a lower priority in order to go through the DIV after ng-show (or ng-hide) completes.
<div class="enclosing" alternate-styles>
HTML from above
</div>
. , . - Angular. -, , jQuery Angular.
/ ?
,