File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,12 @@ export interface MatProgressBarLocation {
66
66
/** @docs -private */
67
67
export function MAT_PROGRESS_BAR_LOCATION_FACTORY ( ) : MatProgressBarLocation {
68
68
const _document = inject ( DOCUMENT ) ;
69
+ const _location = _document ? _document . location : null ;
69
70
70
71
return {
71
- // Note that this needs to be a function, because Angular will only instantiate
72
- // this provider once, but we want the current location on each call.
73
- getPathname : ( ) => ( _document && _document . location && _document . location . pathname ) || ''
72
+ // Note that this needs to be a function, rather than a property, because Angular
73
+ // will only resolve it once, but we want the current path on each call.
74
+ getPathname : ( ) => _location ? ( _location . pathname + _location . search ) : ''
74
75
} ;
75
76
}
76
77
You can’t perform that action at this time.
0 commit comments