daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Oct 12th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export default class shoppingList {
  2.     loaded : boolean = true
  3.     products : product[];
  4.     private subscription : Subscription;
  5.     constructor(private _cartService : cartService) {}
  6.     ngOnInit() {
  7.         // this.loaderService.show();
  8.         this.subscription = this._cartService.CartState
  9.             .subscribe((state : CartState) => {
  10.                 this.products = state.products;
  11.                 console.log(this.products);
  12.             });
  13.  
  14.     }
  15.     ngOnDestroy() {
  16.         this.subscription.unsubscribe();
  17.     }
  18. }
RAW Paste Data
Top