title: Angular Material how set mat-sort-header from mat-table
body: <p>i have the next table from angular material:</p>
  
  <pre><code>&lt;mat-table *ngIf="!waiting" class="table-general table-summary"  #table [dataSource]="dataSource" matSort&gt;
      &lt;mat-header-row class="header_row" *matHeaderRowDef="headerKeys"&gt;&lt;/mat-header-row&gt;
      &lt;mat-row class="row" *matRowDef="let row; columns: headerKeys;"&gt;&lt;/mat-row&gt;
      &lt;ng-container *ngFor="let key of headerKeys; let i = index"&gt;
        &lt;ng-container matColumnDef="{{key}}"&gt;
          &lt;mat-header-cell class="header_name header_{{key}}" *matHeaderCellDef mat-sort-header&gt; {{getHeaderName(key)}} &lt;/mat-header-cell&gt;
          &lt;mat-cell class="cell cell_{{key}}" *matCellDef="let row"&gt;
            &lt;div class="box_cell {{key}}"&gt;
              &lt;div class="current_value ellipsis" *ngIf="key=='customer'"&gt;{{cellValue(row[key])}}&lt;/div&gt;
              &lt;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')"
              &gt;&lt;/mh-box-score&gt;
            &lt;/div&gt;
          &lt;/mat-cell&gt;
        &lt;/ng-container&gt;
      &lt;/ng-container&gt;
    &lt;/mat-table&gt;
  </code></pre>
  
  <p>it's work perfect. Now i want modify the position of sort arrow in the header from after to before <a href="https://material.angular.io/components/sort/api#MatSortHeader" rel="nofollow noreferrer">according to the documentation</a>
  <a href="https://i.stack.imgur.com/0PePV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0PePV.png" alt="enter image description here"></a></p>
  
  <p>I have searched all the ways but I can not do something that seems to be so simple. </p>
  
  <p>Please help, I'm relatively new at angular</p>