Skip to content

Commit a8fc6f0

Browse files
authored
refactor(multiple): remove final usages of InjectFlags (#25896)
Removes all of the remaining usages of the deprecated `InjectFlags` symbol.
1 parent 3de6f3d commit a8fc6f0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/cdk/dialog/dialog.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
OnDestroy,
1414
Type,
1515
StaticProvider,
16-
InjectFlags,
1716
Inject,
1817
Optional,
1918
SkipSelf,
@@ -328,7 +327,7 @@ export class Dialog implements OnDestroy {
328327
if (
329328
config.direction &&
330329
(!userInjector ||
331-
!userInjector.get<Directionality | null>(Directionality, null, InjectFlags.Optional))
330+
!userInjector.get<Directionality | null>(Directionality, null, {optional: true}))
332331
) {
333332
providers.push({
334333
provide: Directionality,

src/material/datepicker/date-range-input-parts.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
Inject,
1616
OnInit,
1717
Injector,
18-
InjectFlags,
1918
DoCheck,
2019
} from '@angular/core';
2120
import {
@@ -112,7 +111,7 @@ abstract class MatDateRangeInputPartBase<D>
112111
// validator. We work around it here by injecting the `NgControl` in `ngOnInit`, after
113112
// everything has been resolved.
114113
// tslint:disable-next-line:no-bitwise
115-
const ngControl = this._injector.get(NgControl, null, InjectFlags.Self | InjectFlags.Optional);
114+
const ngControl = this._injector.get(NgControl, null, {optional: true, self: true});
116115

117116
if (ngControl) {
118117
this.ngControl = ngControl;

0 commit comments

Comments
 (0)