File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,12 @@ import {
13
13
Input ,
14
14
Optional ,
15
15
ViewEncapsulation ,
16
- InjectionToken
16
+ InjectionToken ,
17
+ inject ,
17
18
} from '@angular/core' ;
18
19
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations' ;
19
20
import { CanColor , mixinColor } from '@angular/material/core' ;
21
+ import { DOCUMENT } from '@angular/common' ;
20
22
21
23
// TODO(josephperrott): Benchpress tests.
22
24
// TODO(josephperrott): Add ARIA attributes for progress bar "for".
@@ -49,7 +51,9 @@ export interface MatProgressBarLocation {
49
51
50
52
/** @docs -private */
51
53
export function MAT_PROGRESS_BAR_LOCATION_FACTORY ( ) : MatProgressBarLocation {
52
- return typeof window !== 'undefined' ? window . location : { pathname : '' } ;
54
+ const _document = inject ( DOCUMENT ) ;
55
+ const pathname = ( _document && _document . location && _document . location . pathname ) || '' ;
56
+ return { pathname} ;
53
57
}
54
58
55
59
You can’t perform that action at this time.
0 commit comments