@@ -2,13 +2,10 @@ import {
2
2
Component ,
3
3
ViewEncapsulation ,
4
4
ElementRef ,
5
- ChangeDetectionStrategy ,
6
5
Renderer2 ,
7
6
} from '@angular/core' ;
8
7
import { OverlayContainer } from '@angular/material' ;
9
8
10
- const changeDetectionKey = 'mdDemoChangeDetection' ;
11
-
12
9
/**
13
10
* The entry app for demo site. Routes under `accessibility` will use AccessibilityDemo component,
14
11
* while other demos will use `DemoApp` component. Since DemoApp and AccessibilityDemo use
@@ -35,15 +32,6 @@ export class EntryApp {}
35
32
} )
36
33
export class Home { }
37
34
38
- @Component ( {
39
- moduleId : module . id ,
40
- selector : 'demo-app-on-push' ,
41
- template : '<ng-content></ng-content>' ,
42
- changeDetection : ChangeDetectionStrategy . OnPush ,
43
- encapsulation : ViewEncapsulation . None ,
44
- } )
45
- export class DemoAppOnPush { }
46
-
47
35
/**
48
36
* DemoApp with toolbar and sidenav.
49
37
*/
@@ -56,7 +44,6 @@ export class DemoAppOnPush {}
56
44
} )
57
45
export class DemoApp {
58
46
dark = false ;
59
- changeDetectionStrategy : string ;
60
47
navItems = [
61
48
{ name : 'Autocomplete' , route : '/autocomplete' } ,
62
49
{ name : 'Button' , route : '/button' } ,
@@ -97,14 +84,7 @@ export class DemoApp {
97
84
constructor (
98
85
private _element : ElementRef ,
99
86
private _renderer : Renderer2 ,
100
- private _overlayContainer : OverlayContainer ) {
101
- // Some browsers will throw when trying to access localStorage in incognito.
102
- try {
103
- this . changeDetectionStrategy = window . localStorage . getItem ( changeDetectionKey ) || 'Default' ;
104
- } catch ( error ) {
105
- console . error ( error ) ;
106
- }
107
- }
87
+ private _overlayContainer : OverlayContainer ) { }
108
88
109
89
toggleFullscreen ( ) {
110
90
let elem = this . _element . nativeElement . querySelector ( '.demo-content' ) ;
@@ -119,17 +99,6 @@ export class DemoApp {
119
99
}
120
100
}
121
101
122
- toggleChangeDetection ( ) {
123
- try {
124
- this . changeDetectionStrategy = this . changeDetectionStrategy === 'Default' ?
125
- 'OnPush' : 'Default' ;
126
- window . localStorage . setItem ( changeDetectionKey , this . changeDetectionStrategy ) ;
127
- window . location . reload ( ) ;
128
- } catch ( error ) {
129
- console . error ( error ) ;
130
- }
131
- }
132
-
133
102
toggleTheme ( ) {
134
103
const darkThemeClass = 'unicorn-dark-theme' ;
135
104
0 commit comments