File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ export class SideMenu implements OnInit, OnDestroy {
57
57
private $resourcesNav : any ;
58
58
private $scrollParent : any ;
59
59
60
+ private changedActiveSubscription ;
61
+ private changedSubscription ;
62
+
60
63
constructor (
61
64
elementRef :ElementRef ,
62
65
private scrollService :ScrollService ,
@@ -71,8 +74,10 @@ export class SideMenu implements OnInit, OnDestroy {
71
74
72
75
this . options = optionsService . options ;
73
76
74
- this . menuService . changedActiveItem . subscribe ( ( evt ) => this . changed ( evt ) ) ;
75
- this . menuService . changed . subscribe ( ( evt ) => this . detectorRef . detectChanges ( ) ) ;
77
+ this . changedActiveSubscription = this . menuService . changedActiveItem . subscribe ( ( evt ) => this . changed ( evt ) ) ;
78
+ this . changedSubscription = this . menuService . changed . subscribe ( ( evt ) => {
79
+ this . detectorRef . detectChanges ( )
80
+ } ) ;
76
81
}
77
82
78
83
changed ( item ) {
@@ -141,6 +146,8 @@ export class SideMenu implements OnInit, OnDestroy {
141
146
}
142
147
143
148
destroy ( ) {
149
+ this . changedActiveSubscription . unsubscribe ( ) ;
150
+ this . changedSubscription . unsubscribe ( ) ;
144
151
this . scrollService . unbind ( ) ;
145
152
this . menuService . destroy ( ) ;
146
153
}
You can’t perform that action at this time.
0 commit comments