Angular 如何在英语中使用limito
我尝试在表的行中只显示10个字符,因为我使用了Angular 如何在英语中使用limito,angular,Angular,我尝试在表的行中只显示10个字符,因为我使用了 limitTo: 10 但它不起作用 HTML代码: <ng-container matColumnDef="user_profile_id" > <mat-header-cell *matHeaderCellDef mat-header-cell mat-sort-header> User ID </mat-header-cell>
limitTo: 10
但它不起作用
HTML代码:
<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>
用户ID
{{row.user_id | limito:10}
当我添加“| limito:10”屏幕显示为空时,我在控制台中也没有看到任何错误
我怎样才能解决这个问题?
我使用的是angular 8在angular 8中,您不必限制使用管道,而是使用切片管道: 这是您的代码:
<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>
用户ID
{{row.user_id | slice:0:10}
这是否回答了您的问题?