Skip to content

Commit c5a46e7

Browse files
committed
chore: refer to global variables via the window
1 parent 698743f commit c5a46e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/demo-app/demo-app/demo-app.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class DemoApp {
6969
constructor(private _element: ElementRef) {
7070
// Some browsers will throw when trying to access localStorage in incognito.
7171
try {
72-
this.changeDetectionStrategy = localStorage.getItem(changeDetectionKey) || 'Default';
72+
this.changeDetectionStrategy = window.localStorage.getItem(changeDetectionKey) || 'Default';
7373
} catch (error) {
7474
console.error(error);
7575
}
@@ -92,8 +92,8 @@ export class DemoApp {
9292
try {
9393
this.changeDetectionStrategy = this.changeDetectionStrategy === 'Default' ?
9494
'OnPush' : 'Default';
95-
localStorage.setItem(changeDetectionKey, this.changeDetectionStrategy);
96-
location.reload();
95+
window.localStorage.setItem(changeDetectionKey, this.changeDetectionStrategy);
96+
window.location.reload();
9797
} catch (error) {
9898
console.error(error);
9999
}

0 commit comments

Comments
 (0)