Skip to content

Commit 4e1d85e

Browse files
robertmesserlejelbourn
authored andcommitted
fix(sidenav): fixes sidenav RTL listening for side mode (#465)
closes #411
1 parent 9e308a6 commit 4e1d85e

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/components/sidenav/sidenav.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
Component,
44
ContentChildren,
55
ElementRef,
6-
Host,
76
HostBinding,
87
Input,
98
Optional,
@@ -19,15 +18,13 @@ import {PromiseCompleter} from '@angular2-material/core/async/promise-completer'
1918
import {MdError} from '@angular2-material/core/errors/error';
2019
import { BooleanFieldValue } from '@angular2-material/core/annotations/field-value';
2120

22-
2321
/** Exception thrown when two MdSidenav are matching the same side. */
2422
export class MdDuplicatedSidenavError extends MdError {
2523
constructor(align: string) {
2624
super(`A sidenav was already declared for 'align="${align}"'`);
2725
}
2826
}
2927

30-
3128
/**
3229
* <md-sidenav> component.
3330
*
@@ -223,8 +220,6 @@ export class MdSidenav {
223220
private _closePromiseReject: () => void;
224221
}
225222

226-
227-
228223
/**
229224
* <md-sidenav-layout> component.
230225
*
@@ -263,12 +258,12 @@ export class MdSidenavLayout implements AfterContentInit {
263258
private _left: MdSidenav;
264259
private _right: MdSidenav;
265260

266-
constructor(@Optional() @Host() private _dir: Dir, private _element: ElementRef,
261+
constructor(@Optional() private _dir: Dir, private _element: ElementRef,
267262
private _renderer: Renderer) {
268263
// If a `Dir` directive exists up the tree, listen direction changes and update the left/right
269264
// properties to point to the proper start/end.
270265
if (_dir != null) {
271-
_dir.dirChange.add(() => this._validateDrawers());
266+
_dir.dirChange.subscribe(() => this._validateDrawers());
272267
}
273268
}
274269

src/demo-app/sidenav/sidenav-demo.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import {MdButton} from '@angular2-material/button/button';
33
import {MD_SIDENAV_DIRECTIVES} from '@angular2-material/sidenav/sidenav';
44

55
@Component({
6-
moduleId: module.id,
7-
selector: 'sidenav-demo',
8-
templateUrl: 'sidenav-demo.html',
9-
styleUrls: ['sidenav-demo.css'],
10-
directives: [MD_SIDENAV_DIRECTIVES, MdButton]
6+
moduleId: module.id,
7+
selector: 'sidenav-demo',
8+
templateUrl: 'sidenav-demo.html',
9+
styleUrls: ['sidenav-demo.css'],
10+
directives: [MD_SIDENAV_DIRECTIVES, MdButton]
1111
})
12-
export class SidenavDemo { }
12+
export class SidenavDemo {}

0 commit comments

Comments
 (0)