Module: OrderObjectBy

OrderObjectBy

A filter to extract limit elements beginning at offset out of an array.

Author:
  • Marco Lehmann <marco.lehmann (at) kiwigrid.com>
Source:

Examples

{{ row | orderObjectBy:['col1', 'col2'] }}
{{ row | orderObjectBy:['col1', 'col2']:true }}
angular.module('exampleApp', ['keta.filters.OrderObjectBy'])
    .controller('ExampleController', function($scope) {

        // return object values in given order (all other values are dismissed)
        $scope.orderedProps = $filter('ketaOrderObjectBy')($scope.row, ['col1', 'col2']);

        // return object keys in given order (all other keys are dismissed)
        $scope.orderedProps = $filter('ketaOrderObjectBy')($scope.row, ['col1', 'col2'], true);

    });