diff --git a/js/angular-tablesort.js b/js/angular-tablesort.js index e260aea..55e33b5 100644 --- a/js/angular-tablesort.js +++ b/js/angular-tablesort.js @@ -255,6 +255,11 @@ tableSortModule.directive( 'tsWrapper', ['$parse', '$compile', function( $parse, $scope.wrappingElementClass = $attrs.tsWrappingElementClass; } + // If Current Page is passed in + if ( $attrs.tsCurrentPage ) { + $scope.pagination.currentPage = $scope.$eval($attrs.tsCurrentPage) + } + //local attribute usages of the pagination/filtering options will override the global config if( $attrs.tsPerPageOptions ) { $scope.pagination.perPageOptions = $scope.$eval($attrs.tsPerPageOptions); diff --git a/typedefs/angular-tablesort.d.ts b/typedefs/angular-tablesort.d.ts index 235e54c..e5a7c2b 100644 --- a/typedefs/angular-tablesort.d.ts +++ b/typedefs/angular-tablesort.d.ts @@ -12,6 +12,12 @@ declare module 'angular-tablesort' { declare module 'angular' { export namespace tablesort { export interface ITableSortConfigProvider { + /** + * @description Provide a way to jump to a specific page + * @default first page + */ + currentPage: number; + /** * @description Provide the default function for filtering down items when models change * @default A lowercase string match for values defined by the ts-criteria attributes with ts-filter also on them