Created
January 16, 2020 06:09
-
-
Save ZhenDeng/37d02f959470b640abd9eda0dfaacc72 to your computer and use it in GitHub Desktop.
Using create custom MatSortHeaderIntl intance to modify the labels and text displayed as an example
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
*** In app module providers | |
{ provide: MatSortHeaderIntl, useClass: CustomMatSortHeaderIntl } | |
*** custom-mat-sort-header-intl.ts | |
create custom-mat-sort-header-intl.ts and in the file: | |
import { Injectable } from '@angular/core'; | |
import { Subject } from 'rxjs/internal/Subject'; | |
@Injectable() | |
export class CustomMatSortHeaderIntl{ | |
changes: Subject<void> = new Subject<void>(); | |
sortButtonLabel(id: string) { return `${id} sorting`;}; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment