This repository was archived by the owner on May 4, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ export class ViewController {
47
47
_state : number = STATE_NEW ;
48
48
_cssClass : string ;
49
49
_ts : number ;
50
+ _bindHandler : any ;
50
51
51
52
/**
52
53
* Observable to be subscribed to when the current component will become active
@@ -113,7 +114,8 @@ export class ViewController {
113
114
114
115
this . _cssClass = rootCssClass ;
115
116
this . _ts = Date . now ( ) ;
116
- window . addEventListener ( 'orientationchange' , this . handleOrientationChange . bind ( this ) ) ;
117
+ this . _bindHandler = this . handleOrientationChange . bind ( this ) ;
118
+ window . addEventListener ( 'orientationchange' , this . _bindHandler ) ;
117
119
}
118
120
119
121
handleOrientationChange ( ) {
@@ -542,7 +544,7 @@ export class ViewController {
542
544
renderer . setElementAttribute ( cmpEle , 'style' , null ) ;
543
545
}
544
546
545
- window . removeEventListener ( 'orientationchange' , this . handleOrientationChange . bind ( this ) ) ;
547
+ window . removeEventListener ( 'orientationchange' , this . _bindHandler ) ;
546
548
// completely destroy this component. boom.
547
549
this . _cmp . destroy ( ) ;
548
550
}
You can’t perform that action at this time.
0 commit comments