1
- import { Directive , ElementRef , Input , ViewContainerRef , OnDestroy } from '@angular/core' ;
1
+ import {
2
+ Directive , ElementRef , Input , ViewContainerRef , Optional , OnDestroy
3
+ } from '@angular/core' ;
2
4
import { Overlay , OverlayRef , OverlayState , TemplatePortal } from '../core' ;
3
5
import { MdAutocomplete } from './autocomplete' ;
4
6
import { PositionStrategy } from '../core/overlay/position/position-strategy' ;
5
7
import { Observable } from 'rxjs/Observable' ;
6
8
import { Subscription } from 'rxjs/Subscription' ;
7
9
import 'rxjs/add/observable/merge' ;
10
+ import { Dir } from '../core/rtl/dir' ;
8
11
9
12
/** The panel needs a slight y-offset to ensure the input underline displays. */
10
13
export const MD_AUTOCOMPLETE_PANEL_OFFSET = 6 ;
@@ -27,7 +30,7 @@ export class MdAutocompleteTrigger implements OnDestroy {
27
30
@Input ( 'mdAutocomplete' ) autocomplete : MdAutocomplete ;
28
31
29
32
constructor ( private _element : ElementRef , private _overlay : Overlay ,
30
- private _viewContainerRef : ViewContainerRef ) { }
33
+ private _viewContainerRef : ViewContainerRef , @ Optional ( ) private _dir : Dir ) { }
31
34
32
35
ngOnDestroy ( ) { this . _destroyPanel ( ) ; }
33
36
@@ -95,6 +98,7 @@ export class MdAutocompleteTrigger implements OnDestroy {
95
98
overlayState . width = this . _getHostWidth ( ) ;
96
99
overlayState . hasBackdrop = true ;
97
100
overlayState . backdropClass = 'md-overlay-transparent-backdrop' ;
101
+ overlayState . direction = this . _dir ? this . _dir . value : 'ltr' ;
98
102
return overlayState ;
99
103
}
100
104
0 commit comments