import {
  Component,
  Input,
  ViewEncapsulation,
  Output,
  EventEmitter
} from '@angular/core';
import { CardValues } from '../../models/card-model';
import { CallbackModel } from '../../models/callback-model';
@Component({
  selector: 'app-card',
  templateUrl: './card.component.html',
  styleUrls: ['./card.component.scss'],
  encapsulation: ViewEncapsulation.None
})
export class CardComponent {
  @Input() cardValues: CardValues;
  @Output() methodToExecute: EventEmitter<CallbackModel> = new EventEmitter<
    CallbackModel
  >();

  constructor() {}

  ActionMethod(obj: CallbackModel) {
    this.methodToExecute.emit(obj);
  }

  toggleExpansion() {
    this.cardValues.cardOptions.addWishExpanded = !this.cardValues.cardOptions.addWishExpanded;
  }
}
