Skip to content

Instantly share code, notes, and snippets.

@lotterfriends
Created February 27, 2020 10:42
Show Gist options
  • Save lotterfriends/66063cea71cc02afbe1ad0ce8d7c97da to your computer and use it in GitHub Desktop.
Save lotterfriends/66063cea71cc02afbe1ad0ce8d7c97da to your computer and use it in GitHub Desktop.
german paginator
import {MatPaginatorIntl} from '@angular/material';
export class MatPaginatorIntlDe extends MatPaginatorIntl {
firstPageLabel = 'Erste Seite';
lastPageLabel = 'Letzte Seite';
itemsPerPageLabel = 'Einträge pro Seite';
nextPageLabel = 'Nächste Seite';
previousPageLabel = 'Vorherige Seite';
getRangeLabel = function (page, pageSize, length) {
if (length === 0 || pageSize === 0) {
return '0 von ' + length;
}
length = Math.max(length, 0);
const startIndex = page * pageSize;
// If the start index exceeds the list length, do not try and fix the end index to the end.
const endIndex = startIndex < length ?
Math.min(startIndex + pageSize, length) :
startIndex + pageSize;
return startIndex + 1 + ' - ' + endIndex + ' von ' + length;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment