File tree Expand file tree Collapse file tree 4 files changed +8
-12
lines changed Expand file tree Collapse file tree 4 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,9 @@ import {Direction, Directionality} from './directionality';
2323 */ 
2424@Directive ( { 
2525  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-   ] 
26+   providers : [ { provide : Directionality ,  useExisting : Dir } ] , 
27+   host : { '[dir]' : 'dir' } , 
28+   exportAs : 'dir' , 
3129} ) 
3230export  class  Dir  implements  Directionality  { 
3331  /** Layout direction of the element. */ 
@@ -40,7 +38,6 @@ export class Dir implements Directionality {
4038  @Output ( 'dirChange' )  change  =  new  EventEmitter < void > ( ) ; 
4139
4240  /** @docs -private */ 
43-   @HostBinding ( 'attr.dir' ) 
4441  @Input ( 'dir' ) 
4542  get  dir ( ) : Direction  { 
4643    return  this . _dir ; 
@@ -56,7 +53,6 @@ export class Dir implements Directionality {
5653
5754  /** Current layout direction of the element. */ 
5855  get  value ( ) : Direction  {  return  this . dir ;  } 
59-   set  value ( v : Direction )  {  this . dir  =  v ;  } 
6056
6157  /** Initialize once default value has been set. */ 
6258  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');
3737 */ 
3838@Injectable ( ) 
3939export  class  Directionality  { 
40-   value : Direction  =  'ltr' ; 
41-   change  =  new  EventEmitter < void > ( ) ; 
40+   readonly   value : Direction  =  'ltr' ; 
41+   readonly   change  =  new  EventEmitter < void > ( ) ; 
4242
4343  constructor ( @Optional ( )  @Inject ( DIR_DOCUMENT )  _document ?: any )  { 
4444    if  ( _document )  { 
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ <h1>Angular Material Demos</h1>
4040      </ div > 
4141    </ md-toolbar > 
4242
43-     < div  #root ="$implicit " dir ="ltr " class ="demo-content " [ngSwitch] ="changeDetectionStrategy "> 
43+     < div  #root ="dir " dir ="ltr " class ="demo-content " [ngSwitch] ="changeDetectionStrategy "> 
4444      < div  *ngSwitchDefault > 
4545        < router-outlet > </ router-outlet > 
4646      </ div > 
Original file line number Diff line number Diff line change @@ -210,10 +210,10 @@ describe('MdTabHeader', () => {
210210      beforeEach ( ( )  =>  { 
211211        dir  =  'rtl' ; 
212212        fixture  =  TestBed . createComponent ( SimpleTabHeaderApp ) ; 
213-         fixture . detectChanges ( ) ; 
214- 
215213        appComponent  =  fixture . componentInstance ; 
216214        appComponent . dir  =  'rtl' ; 
215+ 
216+         fixture . detectChanges ( ) ; 
217217      } ) ; 
218218
219219      it ( 'should scroll to show the focused tab label' ,  ( )  =>  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments