Skip to content

Instantly share code, notes, and snippets.

@tkssharma
Created October 12, 2017 07:36
Show Gist options
  • Save tkssharma/8bfec128ba22ed5ea0c7ba0eca18001f to your computer and use it in GitHub Desktop.
Save tkssharma/8bfec128ba22ed5ea0c7ba0eca18001f to your computer and use it in GitHub Desktop.
export default class shoppingCartItem {
@Input()product : product;
constructor(private _cartService : cartService) {}
AddProduct(_product : product) {
_product.added = true;
this
._cartService
.addProduct(_product);
}
RemoveProduct(_product : product) {
_product.added = false;
this
._cartService
.removeProduct(_product.id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment