All files / src/app/shared/components/filter/filter-collapsible filter-collapsible.component.ts

100% Statements 7/7
100% Branches 0/0
100% Functions 3/3
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 242x             2x     2x   2x     2x       1x 1x      
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
 
@Component({
  selector: 'ish-filter-collapsible',
  templateUrl: './filter-collapsible.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FilterCollapsibleComponent implements OnInit {
  @Input({ required: true }) title: string;
  @Input() collapsed: boolean;
  @Output() collapsedChange = new EventEmitter<boolean>();
 
  isCollapsed = false;
 
  ngOnInit() {
    this.isCollapsed = this.collapsed;
  }
 
  toggle() {
    this.isCollapsed = !this.isCollapsed;
    this.collapsedChange.emit(this.isCollapsed);
  }
}