Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 如何在英语中使用limito_Angular - Fatal编程技术网

Angular 如何在英语中使用limito

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>

我尝试在表的行中只显示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>
              <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}

这是否回答了您的问题?