+
diff --git a/src/lib/sidenav/sidenav.spec.ts b/src/lib/sidenav/sidenav.spec.ts
index 712fe2129c89..8d2b4099ed60 100644
--- a/src/lib/sidenav/sidenav.spec.ts
+++ b/src/lib/sidenav/sidenav.spec.ts
@@ -224,6 +224,8 @@ describe('MdSidenav', () => {
expect(sidenavEl.classList).not.toContain('md-sidenav-closed');
expect(sidenavEl.classList).toContain('md-sidenav-opened');
+
+ expect((sidenavEl as any)._openPromise).toBeNull();
});
it('should remove align attr from DOM', () => {
diff --git a/src/lib/sidenav/sidenav.ts b/src/lib/sidenav/sidenav.ts
index a95398efbd9e..6674c1bf6471 100644
--- a/src/lib/sidenav/sidenav.ts
+++ b/src/lib/sidenav/sidenav.ts
@@ -45,7 +45,7 @@ export class MdDuplicatedSidenavError extends MdError {
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
})
-export class MdSidenav {
+export class MdSidenav implements AfterContentInit {
/** Alignment of the sidenav (direction neutral); whether 'start' or 'end'. */
@Input() align: 'start' | 'end' = 'start';
@@ -73,6 +73,15 @@ export class MdSidenav {
*/
constructor(private _elementRef: ElementRef) {}
+ ngAfterContentInit() {
+ // This can happen when the sidenav is set to opened in the template and the transition
+ // isn't ended.
+ if (this._openPromise) {
+ this._openPromiseResolve();
+ this._openPromise = null;
+ }
+ }
+
/**
* Whether the sidenav is opened. We overload this because we trigger an event when it
* starts or end.