Skip to content

Instantly share code, notes, and snippets.

View idleworx's full-sized avatar

idleworx

View GitHub Profile
<table class="table table-striped" ng-if="items.length > 0">
<thead>
<tr>
<th ng-repeat="field in getFieldsSorted(items[0])">
{{field.description}}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="i in items">
Sorting by {{toggles.sort.itemsSort.column}}, reverse = {{toggles.sort.itemsSort.reverse}}.
<br>
<table class="table table-striped" ng-if="items.length > 0">
<thead>
<tr>
<th ng-repeat="field in getFieldsSorted(items[0])" ng-click="toggles.sort.itemsSort.column='fields.'+field.name+'.value';toggles.sort.itemsSort.reverse=!toggles.sort.itemsSort.reverse;">
{{field.description}}
</th>
</tr>
</thead>
Sorting by {{toggles.sort.itemsSort.column}}, reverse = {{toggles.sort.itemsSort.reverse}}.
<br>
<table class="table table-striped" ng-if="items.length > 0">
<thead>
<tr>
<th ng-repeat="field in getFieldsSorted(items[0])" ng-click="toggles.sort.itemsSort.column='fields.'+field.name+'.value';toggles.sort.itemsSort.reverse=!toggles.sort.itemsSort.reverse;">
{{field.description}}
</th>
</tr>
</thead>