@@ -2,13 +2,10 @@ import {
22 Component ,
33 ViewEncapsulation ,
44 ElementRef ,
5- ChangeDetectionStrategy ,
65 Renderer2 ,
76} from '@angular/core' ;
87import { OverlayContainer } from '@angular/material' ;
98
10- const changeDetectionKey = 'mdDemoChangeDetection' ;
11-
129/**
1310 * The entry app for demo site. Routes under `accessibility` will use AccessibilityDemo component,
1411 * while other demos will use `DemoApp` component. Since DemoApp and AccessibilityDemo use
@@ -35,15 +32,6 @@ export class EntryApp {}
3532} )
3633export class Home { }
3734
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-
4735/**
4836 * DemoApp with toolbar and sidenav.
4937 */
@@ -56,7 +44,6 @@ export class DemoAppOnPush {}
5644} )
5745export class DemoApp {
5846 dark = false ;
59- changeDetectionStrategy : string ;
6047 navItems = [
6148 { name : 'Autocomplete' , route : '/autocomplete' } ,
6249 { name : 'Button' , route : '/button' } ,
@@ -97,14 +84,7 @@ export class DemoApp {
9784 constructor (
9885 private _element : ElementRef ,
9986 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 ) { }
10888
10989 toggleFullscreen ( ) {
11090 let elem = this . _element . nativeElement . querySelector ( '.demo-content' ) ;
@@ -119,17 +99,6 @@ export class DemoApp {
11999 }
120100 }
121101
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-
133102 toggleTheme ( ) {
134103 const darkThemeClass = 'unicorn-dark-theme' ;
135104
0 commit comments