angular-sort-buttondeprecated

A simple sort button

Usage no npm install needed!

<script type="module">
  import angularSortButton from 'https://cdn.skypack.dev/angular-sort-button';
</script>

README

angular-sort-button

A simple and lightweight angular sort button component.

Usage

Install

npm install angular-sort-button

Include

angular.module('fancyStuffModule', [
    'apinnecke.sort-button'
]);

or if you're using browserify of something like that:

angular.module('fancyStuffModule', [
    require('angular-sort-button')
]);
<tr>
    <th><sort-button order="order" value="city">City</sort-button></th>
    <th><sort-button order="order" value="price">Price</sort-button></th>
    <th><sort-button order="order" value="status">Status</sort-button></th>
    <th><sort-button order="order" value="color">Color</sort-button></th>
</tr>

Parameter order has two properties: order (which contains the name from current ordering column) and reverse (which contains the boolean flag, weather it is reverse or not).