Skip to content

Commit

Permalink
fix(module: actionsheet): fix actionsheet not destory unsubscribe for…
Browse files Browse the repository at this point in the history
… locale (#236)
  • Loading branch information
Guoyuanqiang authored and 3fuyu committed Jan 10, 2019
1 parent 65ad469 commit d719496
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/action-sheet/action-sheet.component.ts
@@ -1,4 +1,4 @@
import { Component, TemplateRef, ViewEncapsulation, HostListener, OnInit } from '@angular/core';
import { Component, TemplateRef, ViewEncapsulation, HostListener, OnInit, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { LocaleProviderService } from '../locale-provider/locale-provider.service';
Expand All @@ -7,7 +7,7 @@ import { LocaleProviderService } from '../locale-provider/locale-provider.servic
templateUrl: './action-sheet.component.html',
encapsulation: ViewEncapsulation.None
})
export class ActionSheetComponent implements OnInit {
export class ActionSheetComponent implements OnInit, OnDestroy {
unsubscribe$ = new Subject<void>();
option: any;
constructor(private localeProviderService: LocaleProviderService) {}
Expand Down Expand Up @@ -55,4 +55,9 @@ export class ActionSheetComponent implements OnInit {
}
return false;
}

ngOnDestroy() {
this.unsubscribe$.next();
this.unsubscribe$.complete();
}
}

0 comments on commit d719496

Please sign in to comment.