@@ -13,7 +13,7 @@ import {
1313 EventEmitter ,
1414 Renderer ,
1515 ViewEncapsulation ,
16- ViewChild
16+ ViewChild , NgZone
1717} from '@angular/core' ;
1818import { CommonModule } from '@angular/common' ;
1919import { Dir , MdError , coerceBooleanProperty , CompatibilityModule } from '../core' ;
@@ -321,6 +321,7 @@ export class MdSidenav implements AfterContentInit {
321321 ] ,
322322 host : {
323323 '[class.mat-sidenav-container]' : 'true' ,
324+ '[class.mat-sidenav-transition]' : '_initialized' ,
324325 } ,
325326 encapsulation : ViewEncapsulation . None ,
326327} )
@@ -349,8 +350,10 @@ export class MdSidenavContainer implements AfterContentInit {
349350 private _left : MdSidenav ;
350351 private _right : MdSidenav ;
351352
353+ _initialized = false ;
354+
352355 constructor ( @Optional ( ) private _dir : Dir , private _element : ElementRef ,
353- private _renderer : Renderer ) {
356+ private _renderer : Renderer , private _ngZone : NgZone ) {
354357 // If a `Dir` directive exists up the tree, listen direction changes and update the left/right
355358 // properties to point to the proper start/end.
356359 if ( _dir != null ) {
@@ -366,6 +369,9 @@ export class MdSidenavContainer implements AfterContentInit {
366369 this . _watchSidenavAlign ( sidenav ) ;
367370 } ) ;
368371 this . _validateDrawers ( ) ;
372+
373+ // Give the view a chance to render the initial state, then enable transitions.
374+ this . _ngZone . onMicrotaskEmpty . first ( ) . subscribe ( ( ) => this . _initialized = true ) ;
369375 }
370376
371377 /**
0 commit comments