Skip to content

Commit 8fc72e9

Browse files
committed
fix(material/progress-bar): remove deprecated factory functions
Removes factory functions that we had marked as deprecated for v21. These functions aren't necessary since we switched to standalone. BREAKING CHANGE: * `MAT_PROGRESS_BAR_LOCATION_FACTORY` has been removed.
1 parent 6d26c0f commit 8fc72e9

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

goldens/material/progress-bar/index.api.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ export const MAT_PROGRESS_BAR_DEFAULT_OPTIONS: InjectionToken<MatProgressBarDefa
1818
// @public
1919
export const MAT_PROGRESS_BAR_LOCATION: InjectionToken<MatProgressBarLocation>;
2020

21-
// @public @deprecated
22-
export function MAT_PROGRESS_BAR_LOCATION_FACTORY(): MatProgressBarLocation;
23-
2421
// @public (undocumented)
2522
export class MatProgressBar implements AfterViewInit, OnDestroy {
2623
constructor(...args: unknown[]);

src/material/progress-bar/progress-bar.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,19 @@ export const MAT_PROGRESS_BAR_DEFAULT_OPTIONS = new InjectionToken<MatProgressBa
5959
*/
6060
export const MAT_PROGRESS_BAR_LOCATION = new InjectionToken<MatProgressBarLocation>(
6161
'mat-progress-bar-location',
62-
{providedIn: 'root', factory: MAT_PROGRESS_BAR_LOCATION_FACTORY},
62+
{
63+
providedIn: 'root',
64+
factory: () => {
65+
const _document = inject(DOCUMENT);
66+
const _location = _document ? _document.location : null;
67+
68+
return {
69+
// Note that this needs to be a function, rather than a property, because Angular
70+
// will only resolve it once, but we want the current path on each call.
71+
getPathname: () => (_location ? _location.pathname + _location.search : ''),
72+
};
73+
},
74+
},
6375
);
6476

6577
/**
@@ -70,22 +82,6 @@ export interface MatProgressBarLocation {
7082
getPathname: () => string;
7183
}
7284

73-
/**
74-
* @docs-private
75-
* @deprecated No longer used, will be removed.
76-
* @breaking-change 21.0.0
77-
*/
78-
export function MAT_PROGRESS_BAR_LOCATION_FACTORY(): MatProgressBarLocation {
79-
const _document = inject(DOCUMENT);
80-
const _location = _document ? _document.location : null;
81-
82-
return {
83-
// Note that this needs to be a function, rather than a property, because Angular
84-
// will only resolve it once, but we want the current path on each call.
85-
getPathname: () => (_location ? _location.pathname + _location.search : ''),
86-
};
87-
}
88-
8985
export type ProgressBarMode = 'determinate' | 'indeterminate' | 'buffer' | 'query';
9086

9187
@Component({

0 commit comments

Comments
 (0)