These are chat archives for angular/material

13th
Mar 2018
satishgorijala-github
@satishgorijala-github
Mar 13 2018 03:11
Value not pertaining even after it met the condition.

<mat-tab-group [selectedIndex]="tabselectedIndex">

ngOnInit() {

 this.tabselectedIndex = 0;
    this._router.events
    .filter(e => e instanceof RoutesRecognized)
    .pairwise()
    .subscribe((e: any[]) => {
      console.log(this.previousRoute);
      this.previousRoute = e[0].urlAfterRedirects;
        if (this.previousRoute === '/contactus') {
                    this.tabselectedIndex = 1;
                    alert(this.tabselectedIndex);
                  }
              });

}

Though it met the critieria and the alert popup shows value as "1", but in html for the mat-tab the value is not changing to "1". Always the value is "0". what i am missing here
VishwajitShinde
@VishwajitShinde
Mar 13 2018 12:02
Hello Guys
Why my mat-table columns are not sorting?
<mat-header-cell *matHeaderCellDef mat-sort-header="true" > {{ column.myHeader }} </mat-header-cell> . Am I missing anything into this?
satishgorijala-github
@satishgorijala-github
Mar 13 2018 12:48
@VishwajitShinde - You can try as below
<mat-table #table [dataSource]="dataSource" matSort>
                  <ng-container matColumnDef="colname">
                    <mat-header-cell *matHeaderCellDef mat-sort-header> column heading </mat-header-cell>
                  </ng-container>