mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(icon): account for query params when prefixing external references (#13930)
Fixes `mat-icon` ignoring query params when prefixing external references inside the SVG. Fixes #13924.
This commit is contained in:
committed by
vivian-hu
parent
2290063ec8
commit
4ce5ee0a6c
@@ -59,11 +59,12 @@ export interface MatIconLocation {
|
||||
/** @docs-private */
|
||||
export function MAT_ICON_LOCATION_FACTORY(): MatIconLocation {
|
||||
const _document = inject(DOCUMENT);
|
||||
const _location = _document ? _document.location : null;
|
||||
|
||||
return {
|
||||
// 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: () => (_document && _document.location && _document.location.pathname) || ''
|
||||
getPathname: () => _location ? (_location.pathname + _location.search) : ''
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user