Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions dist/ng-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1388,11 +1388,28 @@
'ng-table-pagination': 'params',
'template-url': 'templates.pagination'
});
$element.after(paginationTemplate);
if (headerTemplate) {
$compile(headerTemplate)($scope);
}
$compile(paginationTemplate)($scope);

// this allows to add the attribute table-pagination-top to ngTable
// so you will see the pagination at the top
if(typeof($attrs.tablePaginationTop) !== 'undefined') {
var topTemplate = paginationTemplate.clone();
$element.parent().prepend(topTemplate);
$compile(topTemplate)($scope);
}

// this rewrites the original behaviour, you need to add the attribute table-pagination-bottom
// so you will see the pagination at the bottom as the original
if(typeof($attrs.tablePaginationBottom) !== 'undefined') {
var bottomTemplate = paginationTemplate.clone();
$element.parent().append(bottomTemplate);
$compile(bottomTemplate)($scope);
}

// finally you can use the two at the same time
// is a good user experience when the ngTable shows a big number of rows
}
};

Expand Down