Sha256: dd3ea4ca79222fdcd2b801b5a09d86067cf30be3834c004e1f9b96b3cc978942

Contents?: true

Size: 987 Bytes

Versions: 3

Compression:

Stored size: 987 Bytes

Contents

var app = angular.module('main', ['ngTable']).controller('DemoCtrl', function($scope, $http, $filter, ngTableParams) {
  $http.get('matrix.json').success(function(data, status, headers, config){
    $scope.tableParams = new ngTableParams({
        page: 1,            // show first page
        count: data.length  // count per page
    }, {
        counts: [],
        groupBy: 'suite',
        filter: {
            scenario: ''       // initial filter
        },
        total: data.length,
        getData: function($defer, params) {
          var filteredData = params.filter() ?
              $filter('filter')(data, params.filter()) :
              data;
          var orderedData = params.sorting() ?
              $filter('orderBy')(filteredData, params.orderBy()) :
              data;

            params.total(orderedData.length);
            $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
        }
    });
  });
})

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
omnitest-0.2.2 resources/generators/dashboard/files/dashboard.js
omnitest-0.2.1 resources/generators/dashboard/files/dashboard.js
polytrix-0.1.4 resources/generators/dashboard/files/dashboard.js