File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ import {
16
16
ComponentRef ,
17
17
OnDestroy ,
18
18
Type ,
19
- StaticProvider
19
+ StaticProvider ,
20
+ InjectFlags
20
21
} from '@angular/core' ;
21
22
import { ComponentPortal , TemplatePortal } from '@angular/cdk/portal' ;
22
23
import { of as observableOf , Observable , Subject , defer } from 'rxjs' ;
@@ -285,8 +286,8 @@ export class Dialog implements OnDestroy {
285
286
{ provide : DIALOG_DATA , useValue : config . data }
286
287
] ;
287
288
288
- if ( config . direction &&
289
- ( ! userInjector || ! userInjector . get < Directionality | null > ( Directionality , null ) ) ) {
289
+ if ( config . direction && ( ! userInjector ||
290
+ ! userInjector . get < Directionality | null > ( Directionality , null , InjectFlags . Optional ) ) ) {
290
291
providers . push ( {
291
292
provide : Directionality ,
292
293
useValue : { value : config . direction , change : observableOf ( ) }
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {
20
20
Inject ,
21
21
OnDestroy ,
22
22
StaticProvider ,
23
+ InjectFlags ,
23
24
} from '@angular/core' ;
24
25
import { of as observableOf } from 'rxjs' ;
25
26
import { MAT_BOTTOM_SHEET_DATA , MatBottomSheetConfig } from './bottom-sheet-config' ;
@@ -191,8 +192,8 @@ export class MatBottomSheet implements OnDestroy {
191
192
{ provide : MAT_BOTTOM_SHEET_DATA , useValue : config . data }
192
193
] ;
193
194
194
- if ( config . direction &&
195
- ( ! userInjector || ! userInjector . get < Directionality | null > ( Directionality , null ) ) ) {
195
+ if ( config . direction && ( ! userInjector ||
196
+ ! userInjector . get < Directionality | null > ( Directionality , null , InjectFlags . Optional ) ) ) {
196
197
providers . push ( {
197
198
provide : Directionality ,
198
199
useValue : { value : config . direction , change : observableOf ( ) }
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {
20
20
Directive ,
21
21
Inject ,
22
22
Injectable ,
23
+ InjectFlags ,
23
24
InjectionToken ,
24
25
Injector ,
25
26
OnDestroy ,
@@ -307,8 +308,8 @@ export abstract class _MatDialogBase<C extends _MatDialogContainerBase> implemen
307
308
{ provide : this . _dialogRefConstructor , useValue : dialogRef }
308
309
] ;
309
310
310
- if ( config . direction &&
311
- ( ! userInjector || ! userInjector . get < Directionality | null > ( Directionality , null ) ) ) {
311
+ if ( config . direction && ( ! userInjector ||
312
+ ! userInjector . get < Directionality | null > ( Directionality , null , InjectFlags . Optional ) ) ) {
312
313
providers . push ( {
313
314
provide : Directionality ,
314
315
useValue : { value : config . direction , change : observableOf ( ) }
You can’t perform that action at this time.
0 commit comments