/** * @ngdoc FbTablePaging * @name fasit.component.FbTablePaging§ * @function * * @description * Pagentering till fbtable * */ // Använd fb-table.component.ts för Angular fbDeprecatedFile('fbTablePaging'); angular.module('fasit') .directive('fbTablePaging', function () { 'use strict'; var link = function (scope: fb.IFbTablePaging, element: ng.IAugmentedJQuery, attrs: ng.IAttributes) { fbDeprecated('fbTablePaging'); scope.pages = []; for (var i = 0; i < scope.arrayLength / scope.itemsPerPage; i++) { scope.pages.push(i); } scope.next = function () { if (scope.selectedPage < scope.pages.length-1) { scope.selectedPage++; } } scope.prev = function () { if (scope.selectedPage > 0) { scope.selectedPage--; } } }; return { restrict: 'E', replace: true, link:link, scope: { itemsPerPage: '=', selectedPage: '=', arrayLength: '=', }, templateUrl: 'app/Directives/fbTablePaging/fbTablePaging.html', }; });