mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(progress-bar): account for query params when prefixing references (#13942)
Fixes the progress bar not accounting for URL query params when it prefixes its SVG references. Related to #13930.
This commit is contained in:
committed by
vivian-hu
parent
27347b58b4
commit
2290063ec8
@@ -66,11 +66,12 @@ export interface MatProgressBarLocation {
|
||||
/** @docs-private */
|
||||
export function MAT_PROGRESS_BAR_LOCATION_FACTORY(): MatProgressBarLocation {
|
||||
const _document = inject(DOCUMENT);
|
||||
const _location = _document ? _document.location : null;
|
||||
|
||||
return {
|
||||
// Note that this needs to be a function, because Angular will only instantiate
|
||||
// this provider once, but we want the current location on each call.
|
||||
getPathname: () => (_document && _document.location && _document.location.pathname) || ''
|
||||
// Note that this needs to be a function, rather than a property, because Angular
|
||||
// will only resolve it once, but we want the current path on each call.
|
||||
getPathname: () => _location ? (_location.pathname + _location.search) : ''
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user