Created
February 27, 2020 10:42
-
-
Save lotterfriends/66063cea71cc02afbe1ad0ce8d7c97da to your computer and use it in GitHub Desktop.
german paginator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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