Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { ISubscription } from "rxjs/Subscription";
- ....
- export class MyComponent implements OnDestroy, OnInit {
- private showModalStreamSubscription: ISubscription;
- ...
- ngOnInit() {
- this.mySubscription = this.myService.doSomething.subscribe(() => {
- this.thingToDo();
- });
- }
- ...
- ngOnDestroy() {
- this.mySubscription.unsubscribe();
- }
- ...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement