@@ -17,7 +17,7 @@ import { IgxNavigationService, IToggleView } from '../../core/navigation';
1717import { IgxOverlayService } from '../../services/overlay/overlay' ;
1818import { OverlaySettings , OverlayEventArgs , ConnectedPositioningStrategy , AbsoluteScrollStrategy } from '../../services' ;
1919import { filter , takeUntil } from 'rxjs/operators' ;
20- import { Subscription , OperatorFunction , Subject } from 'rxjs' ;
20+ import { Subscription , Subject , MonoTypeOperatorFunction } from 'rxjs' ;
2121import { OverlayCancelableEventArgs } from '../../services/overlay/utilities' ;
2222import { CancelableEventArgs } from '../../core/utils' ;
2323
@@ -28,8 +28,9 @@ import { CancelableEventArgs } from '../../core/utils';
2828export class IgxToggleDirective implements IToggleView , OnInit , OnDestroy {
2929 private _overlayId : string ;
3030 private destroy$ = new Subject < boolean > ( ) ;
31- private _overlaySubFilter : OperatorFunction < OverlayEventArgs , OverlayEventArgs > [ ] = [
32- filter ( x => x . id === this . _overlayId )
31+ private _overlaySubFilter : [ MonoTypeOperatorFunction < OverlayEventArgs > , MonoTypeOperatorFunction < OverlayEventArgs > ] = [
32+ filter ( x => x . id === this . _overlayId ) ,
33+ takeUntil ( this . destroy$ )
3334 ] ;
3435 private _overlayOpenedSub : Subscription ;
3536 private _overlayClosingSub : Subscription ;
@@ -189,12 +190,12 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
189190 }
190191
191192 this . unsubscribe ( ) ;
192- this . _overlayOpenedSub = this . overlayService . onOpened . pipe ( ...this . _overlaySubFilter , takeUntil ( this . destroy$ ) ) . subscribe ( ( ) => {
193+ this . _overlayOpenedSub = this . overlayService . onOpened . pipe ( ...this . _overlaySubFilter ) . subscribe ( ( ) => {
193194 this . onOpened . emit ( ) ;
194195 } ) ;
195196 this . _overlayClosingSub = this . overlayService
196197 . onClosing
197- . pipe ( ...this . _overlaySubFilter , takeUntil ( this . destroy$ ) )
198+ . pipe ( ...this . _overlaySubFilter )
198199 . subscribe ( ( e : OverlayCancelableEventArgs ) => {
199200 const eventArgs : CancelableEventArgs = { cancel : false } ;
200201 this . onClosing . emit ( eventArgs ) ;
@@ -208,7 +209,7 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
208209 }
209210 } ) ;
210211 this . _overlayClosedSub = this . overlayService . onClosed
211- . pipe ( ...this . _overlaySubFilter , takeUntil ( this . destroy$ ) )
212+ . pipe ( ...this . _overlaySubFilter )
212213 . subscribe ( this . overlayClosed ) ;
213214 }
214215
0 commit comments