import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';

export interface CategoryFilter {
  id: number,
  title: string,
  filters: Array<{
    id: number,
    name: string,
    selected?: boolean
  }>
}
@Component({
  selector: 'app-category-filter-modal',
  templateUrl: './category-filter-modal.component.html',
  styleUrls: ['./category-filter-modal.component.css']
})
export class CategoryFilterModalComponent implements OnInit {

  @Input() filters: any;
  @Output() catFilter = new EventEmitter<{ catId: number, filterId: number }>();

  @Input() catFilters: CategoryFilter[];


  constructor() { }

  ngOnInit() {
  }

  selectedFilter(cat, ID) {

    this.catFilter.emit({ catId: cat.id, filterId: ID });
  }

}
