Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { ISubscription } from "rxjs/Subscription";
  2. ....
  3. export class MyComponent implements OnDestroy, OnInit {
  4.     private showModalStreamSubscription: ISubscription;
  5. ...
  6.     ngOnInit() {
  7.         this.mySubscription = this.myService.doSomething.subscribe(() => {
  8.             this.thingToDo();
  9.         });
  10.     }
  11. ...
  12.     ngOnDestroy() {
  13.         this.mySubscription.unsubscribe();
  14.     }
  15. ...
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement