File tree Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -149,10 +149,6 @@ export class MatDialogContent {}
149149} ) 
150150export  class  MatDialogActions  { } 
151151
152- // TODO(crisbeto): this utility shouldn't be necessary anymore, because the dialog ref is provided 
153- // both to component and template dialogs through DI. We need to keep it around, because there are 
154- // some internal wrappers around `MatDialog` that happened to work by accident, because we had this 
155- // fallback logic in place. 
156152/** 
157153 * Finds the closest MatDialogRef to an element by looking at the DOM. 
158154 * @param  element Element relative to which to look for a dialog. 
Original file line number Diff line number Diff line change @@ -292,21 +292,16 @@ export abstract class _MatDialogBase<C extends _MatDialogContainerBase> implemen
292292    // Create a reference to the dialog we're creating in order to give the user a handle 
293293    // to modify and close it. 
294294    const  dialogRef  =  new  this . _dialogRefConstructor ( overlayRef ,  dialogContainer ,  config . id ) ; 
295-     const  injector  =  this . _createInjector < T > ( config ,  dialogRef ,  dialogContainer ) ; 
296295
297296    if  ( componentOrTemplateRef  instanceof  TemplateRef )  { 
298297      dialogContainer . attachTemplatePortal ( 
299-         new  TemplatePortal < T > ( 
300-           componentOrTemplateRef , 
301-           null ! , 
302-           < any > { 
303-             $implicit : config . data , 
304-             dialogRef, 
305-           } , 
306-           injector , 
307-         ) , 
298+         new  TemplatePortal < T > ( componentOrTemplateRef ,  null ! ,  < any > { 
299+           $implicit : config . data , 
300+           dialogRef, 
301+         } ) , 
308302      ) ; 
309303    }  else  { 
304+       const  injector  =  this . _createInjector < T > ( config ,  dialogRef ,  dialogContainer ) ; 
310305      const  contentRef  =  dialogContainer . attachComponentPortal < T > ( 
311306        new  ComponentPortal ( 
312307          componentOrTemplateRef , 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments