File tree Expand file tree Collapse file tree 4 files changed +8
-13
lines changed Expand file tree Collapse file tree 4 files changed +8
-13
lines changed Original file line number Diff line number Diff line change 8
8
9
9
import {
10
10
Directive ,
11
- HostBinding ,
12
11
Output ,
13
12
Input ,
14
13
EventEmitter
@@ -23,11 +22,9 @@ import {Direction, Directionality} from './directionality';
23
22
*/
24
23
@Directive ( {
25
24
selector : '[dir]' ,
26
- // TODO(hansl): maybe `$implicit` isn't the best option here, but for now that's the best we got.
27
- exportAs : '$implicit' ,
28
- providers : [
29
- { provide : Directionality , useExisting : Dir }
30
- ]
25
+ providers : [ { provide : Directionality , useExisting : Dir } ] ,
26
+ host : { '[dir]' : 'dir' } ,
27
+ exportAs : 'dir' ,
31
28
} )
32
29
export class Dir implements Directionality {
33
30
/** Layout direction of the element. */
@@ -40,7 +37,6 @@ export class Dir implements Directionality {
40
37
@Output ( 'dirChange' ) change = new EventEmitter < void > ( ) ;
41
38
42
39
/** @docs -private */
43
- @HostBinding ( 'attr.dir' )
44
40
@Input ( 'dir' )
45
41
get dir ( ) : Direction {
46
42
return this . _dir ;
@@ -56,7 +52,6 @@ export class Dir implements Directionality {
56
52
57
53
/** Current layout direction of the element. */
58
54
get value ( ) : Direction { return this . dir ; }
59
- set value ( v : Direction ) { this . dir = v ; }
60
55
61
56
/** Initialize once default value has been set. */
62
57
ngAfterContentInit ( ) {
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ export const DIR_DOCUMENT = new InjectionToken<Document>('md-dir-doc');
37
37
*/
38
38
@Injectable ( )
39
39
export class Directionality {
40
- value : Direction = 'ltr' ;
41
- change = new EventEmitter < void > ( ) ;
40
+ readonly value : Direction = 'ltr' ;
41
+ readonly change = new EventEmitter < void > ( ) ;
42
42
43
43
constructor ( @Optional ( ) @Inject ( DIR_DOCUMENT ) _document ?: any ) {
44
44
if ( _document ) {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ <h1>Angular Material Demos</h1>
40
40
</ div >
41
41
</ md-toolbar >
42
42
43
- < div #root ="$implicit " dir ="ltr " class ="demo-content " [ngSwitch] ="changeDetectionStrategy ">
43
+ < div #root ="dir " dir ="ltr " class ="demo-content " [ngSwitch] ="changeDetectionStrategy ">
44
44
< div *ngSwitchDefault >
45
45
< router-outlet > </ router-outlet >
46
46
</ div >
Original file line number Diff line number Diff line change @@ -210,10 +210,10 @@ describe('MdTabHeader', () => {
210
210
beforeEach ( ( ) => {
211
211
dir = 'rtl' ;
212
212
fixture = TestBed . createComponent ( SimpleTabHeaderApp ) ;
213
- fixture . detectChanges ( ) ;
214
-
215
213
appComponent = fixture . componentInstance ;
216
214
appComponent . dir = 'rtl' ;
215
+
216
+ fixture . detectChanges ( ) ;
217
217
} ) ;
218
218
219
219
it ( 'should scroll to show the focused tab label' , ( ) => {
You can’t perform that action at this time.
0 commit comments