All files / src/app/shared/components/mat-panel-header mat-panel-header.component.ts

58.33% Statements 7/12
0% Branches 0/2
33.33% Functions 1/3
50% Lines 5/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241x               1x       1x           1x       1x  
import { Component, OnInit, Input, ElementRef, ViewEncapsulation } from '@angular/core';
 
@Component({
  selector: 'mat-panel-header',
  encapsulation: ViewEncapsulation.None,
  templateUrl: './mat-panel-header.component.html',
  styleUrls: ['./mat-panel-header.component.less']
})
export class MatPanelHeaderComponent {
  _isShow = true;
  _el: HTMLElement;
 
  @Input() tableName: string;
 
  constructor(private _elementRef: ElementRef) {
    this._el = this._elementRef.nativeElement;
  }
 
  toggleShow() {
    this._isShow = !this._isShow;
    this._el.nextElementSibling['style'].display = this._isShow === true ? '' : 'none';
  }
}