Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created October 12, 2017 07:37
Show Gist options
  • Save tkssharma/e7c5d11cadd35a5ae7a2cdd3c61febff to your computer and use it in GitHub Desktop.
Save tkssharma/e7c5d11cadd35a5ae7a2cdd3c61febff to your computer and use it in GitHub Desktop.
export default class shoppingList {
loaded : boolean = true
products : product[];
private subscription : Subscription;
constructor(private _cartService : cartService) {}
ngOnInit() {
// this.loaderService.show();
this.subscription = this._cartService.CartState
.subscribe((state : CartState) => {
this.products = state.products;
console.log(this.products);
});
}
ngOnDestroy() {
this.subscription.unsubscribe();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment