We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2290063 commit 4ce5ee0Copy full SHA for 4ce5ee0
src/lib/icon/icon.ts
@@ -59,11 +59,12 @@ export interface MatIconLocation {
59
/** @docs-private */
60
export function MAT_ICON_LOCATION_FACTORY(): MatIconLocation {
61
const _document = inject(DOCUMENT);
62
+ const _location = _document ? _document.location : null;
63
64
return {
65
// Note that this needs to be a function, rather than a property, because Angular
66
// will only resolve it once, but we want the current path on each call.
- getPathname: () => (_document && _document.location && _document.location.pathname) || ''
67
+ getPathname: () => _location ? (_location.pathname + _location.search) : ''
68
};
69
}
70
0 commit comments