2017-02-16 12 views
1

デフォルトでは、角度2の材質2のタブ内容は左右にスライドします。すべての機能(ラベルにHTMLを入れる機能やクリーンなテンプレート構文など)を維持しながら、移行を変更または無効にする方法はありますか?角材2タブ:ボディトランジションの削除


私は現在、私が嫌いこの回避策を使用していますが、私はそれから、ケースの誰も他の利点にここに残します:

component.html:

<md-tab-group [selectedIndex]="selectedIndex" 
(selectChange)="changeSelectedIndex($event)"> 
    <md-tab> 
     <template md-tab-label> 
     1 
     </template> 
    </md-tab> 
    <md-tab> 
     <template md-tab-label> 
     2 
     </template> 
    </md-tab> 
</md-tab-group> 

<div *ngIf="selectedIndex===0"> 
    Body for 1 
</div> 
<div *ngIf="selectedIndex===1"> 
    Body for 2 
</div> 

component.tsを(タブグループごとに異なるselectedIndexとchangeSelectedIndexが必要です)。

selectedIndex: number = 0; 

changeSelectedIndex(event) { 
    this.selectedIndex = event.index; 
} 

答えて

0

追加:

[@.disabled]="true" 

アニメーションの遷移を無効にするHTMLに。

関連する問題