Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement