Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.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 角度材料如何从材料表设置材料分类标题_Angular_Typescript_Angular Material2 - Fatal编程技术网

Angular 角度材料如何从材料表设置材料分类标题

Angular 角度材料如何从材料表设置材料分类标题,angular,typescript,angular-material2,Angular,Typescript,Angular Material2,我有下一张来自angular material的表格: <mat-table *ngIf="!waiting" class="table-general table-summary" #table [dataSource]="dataSource" matSort> <mat-header-row class="header_row" *matHeaderRowDef="headerKeys"></mat-header-row> <ma

我有下一张来自angular material的表格:

<mat-table *ngIf="!waiting" class="table-general table-summary"  #table [dataSource]="dataSource" matSort>
    <mat-header-row class="header_row" *matHeaderRowDef="headerKeys"></mat-header-row>
    <mat-row class="row" *matRowDef="let row; columns: headerKeys;"></mat-row>
    <ng-container *ngFor="let key of headerKeys; let i = index">
      <ng-container matColumnDef="{{key}}">
        <mat-header-cell class="header_name header_{{key}}" *matHeaderCellDef mat-sort-header> {{getHeaderName(key)}} </mat-header-cell>
        <mat-cell class="cell cell_{{key}}" *matCellDef="let row">
          <div class="box_cell {{key}}">
            <div class="current_value ellipsis" *ngIf="key=='customer'">{{cellValue(row[key])}}</div>
            <mh-box-score
              *ngIf="key!='customer'"
              [value]="cellValue(row[key])"
              [type]="cellValue(row[key],'type')+' small'"
              [type_number]="'percent'"
              [previous_value]="cellValue(row[key],'diff')"
              [previous]="cellValue(row[key],'previousLabel')"
            ></mh-box-score>
          </div>
        </mat-cell>
      </ng-container>
    </ng-container>
  </mat-table>

{{getHeaderName(键)}
{{cellValue(行[key])}
这是完美的工作。现在我想修改排序箭头在标题中的位置,从后面改为前面

我已经寻找了所有的方法,但我不能做一些看起来如此简单的事情


请帮助,我在angular方面相对较新

为了移动箭头,您需要将
@Input()
项指令
arrowPosition
应用于具有
mat sort header
的DOM元素:
甜点(100g)


如何将
箭头位置
应用于直接从物料示例派生的各种表格标题。

类型“string”不可分配给类型“MenuPositionX”@GerardoBuenrostroGonzález Working stackblitz,以下是显示相同格式的文档(并且输入是字符串。答案是正确的,因此您的错误可能来自不正确的导入或其他来源。