|
6 | 6 | * found in the LICENSE file at https://angular.dev/license
|
7 | 7 | */
|
8 | 8 |
|
9 |
| -import {FactoryProvider, Injectable, Optional, SkipSelf, OnDestroy} from '@angular/core'; |
| 9 | +import {FactoryProvider, Injectable, OnDestroy, inject} from '@angular/core'; |
10 | 10 | import {DateAdapter} from '../core';
|
11 | 11 | import {Observable, Subject} from 'rxjs';
|
12 | 12 |
|
@@ -211,50 +211,26 @@ export class MatRangeDateSelectionModel<D> extends MatDateSelectionModel<DateRan
|
211 | 211 | }
|
212 | 212 | }
|
213 | 213 |
|
214 |
| -/** |
215 |
| - * @docs-private |
216 |
| - * @deprecated No longer used, will be removed. |
217 |
| - * @breaking-change 21.0.0 |
218 |
| - */ |
219 |
| -export function MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY( |
220 |
| - parent: MatSingleDateSelectionModel<unknown>, |
221 |
| - adapter: DateAdapter<unknown>, |
222 |
| -) { |
223 |
| - return parent || new MatSingleDateSelectionModel(adapter); |
224 |
| -} |
225 |
| - |
226 | 214 | /**
|
227 | 215 | * Used to provide a single selection model to a component.
|
228 | 216 | * @docs-private
|
229 |
| - * @deprecated No longer used, will be removed. |
230 |
| - * @breaking-change 21.0.0 |
231 | 217 | */
|
232 | 218 | export const MAT_SINGLE_DATE_SELECTION_MODEL_PROVIDER: FactoryProvider = {
|
233 | 219 | provide: MatDateSelectionModel,
|
234 |
| - deps: [[new Optional(), new SkipSelf(), MatDateSelectionModel], DateAdapter], |
235 |
| - useFactory: MAT_SINGLE_DATE_SELECTION_MODEL_FACTORY, |
| 220 | + useFactory: () => { |
| 221 | + const parent = inject(MatDateSelectionModel, {optional: true, skipSelf: true}); |
| 222 | + return parent || new MatSingleDateSelectionModel(inject(DateAdapter)); |
| 223 | + }, |
236 | 224 | };
|
237 | 225 |
|
238 |
| -/** |
239 |
| - * @docs-private |
240 |
| - * @deprecated No longer used, will be removed. |
241 |
| - * @breaking-change 21.0.0 |
242 |
| - */ |
243 |
| -export function MAT_RANGE_DATE_SELECTION_MODEL_FACTORY( |
244 |
| - parent: MatSingleDateSelectionModel<unknown>, |
245 |
| - adapter: DateAdapter<unknown>, |
246 |
| -) { |
247 |
| - return parent || new MatRangeDateSelectionModel(adapter); |
248 |
| -} |
249 |
| - |
250 | 226 | /**
|
251 | 227 | * Used to provide a range selection model to a component.
|
252 | 228 | * @docs-private
|
253 |
| - * @deprecated No longer used, will be removed. |
254 |
| - * @breaking-change 21.0.0 |
255 | 229 | */
|
256 | 230 | export const MAT_RANGE_DATE_SELECTION_MODEL_PROVIDER: FactoryProvider = {
|
257 | 231 | provide: MatDateSelectionModel,
|
258 |
| - deps: [[new Optional(), new SkipSelf(), MatDateSelectionModel], DateAdapter], |
259 |
| - useFactory: MAT_RANGE_DATE_SELECTION_MODEL_FACTORY, |
| 232 | + useFactory: () => { |
| 233 | + const parent = inject(MatDateSelectionModel, {optional: true, skipSelf: true}); |
| 234 | + return parent || new MatRangeDateSelectionModel(inject(DateAdapter)); |
| 235 | + }, |
260 | 236 | };
|
0 commit comments