Guest User

Untitled

a guest
Oct 18th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. @Component({})
  2. export class ExampleComponent implements OnDestroy{
  3.  
  4. private subscriptions = [];
  5.  
  6. constructor(){
  7. this.subscriptions.push(this.anyObservable.subscribe());
  8. }
  9.  
  10. ngOnDestroy(){
  11. for(let subscription of this.subscriptions){
  12. subscriptions.unsubscribe();
  13. }
  14. }
  15. }
Add Comment
Please, Sign In to add comment