Reputation: 275
I have tried to display only 10 characters in the row of a table, for that I have used
limitTo: 10
but it is not working,
HTML code:
<ng-container matColumnDef="user_profile_id" >
<mat-header-cell *matHeaderCellDef mat-header-cell mat-sort-header> User ID </mat-header-cell>
<mat-cell *matCellDef="let row " data-label="User UID" matTooltip={{row.user_profile_id}} > {{row.user_id| limitTo:10}} </mat-cell>
</ng-container>
when I add " | limitTo:10" screen is displaying empty, I am not seeing any errors in the console also.
how can I solve this? I am using angular 8
Upvotes: 2
Views: 407
Reputation: 716
in angular 8 you don't have limitTo pipe instead use slice pipe (docs): here is your code:
<ng-container matColumnDef="user_profile_id" >
<mat-header-cell *matHeaderCellDef mat-header-cell mat-sort-header> User ID </mat-header-cell>
<mat-cell *matCellDef="let row " data-label="User UID" matTooltip={{row.user_profile_id}} > {{row.user_id| slice:0:10}} </mat-cell>
</ng-container>
Upvotes: 5