import { Component } from '@angular/core' ; import { WishListItemComponent } from '@spartacus/storefront' ; import { CartService } from '@spartacus/core' ; @ Component ( { selector : 'app-dvnt-wish-list-item' , templateUrl : './dvnt-wish-list-item.component.html' , styleUrls : [ './dvnt-wish-list-item.component.scss' ] , } ) export class DvntWishListItemComponent extends WishListItemComponent { constructor ( private cartService ) { super ( ) ; } public addToCart ( ) { if ( ! this . cartEntry . product . code || this . cartEntry . quantity <= 0 ) { return ; } this . cartService . addEntry ( this . cartEntry . product . code , this . cartEntry . quantity ) ; this . remove . emit ( this . cartEntry ) ; } }