import { ChangeDetectionStrategy , Component , ElementRef , Input , ViewChild } from '@angular/core' ; param pager { Object } @ Component ( { changeDetection : ChangeDetectionStrategy . OnPush , selector : 'pager-cities' , styleUrls : [ './pager-cities.component.scss' ] , templateUrl : './pager-cities.component.html' } ) export class PagerCitiesComponent { columnsToDisplay = [ 'mmi' , 'city' , 'population' ] ; @ Input ( ) pager : any ; @ ViewChild ( 'citiesTable' , { read : ElementRef , static : false } ) tableEl : ElementRef ; param checkbox onChange ( checkbox ) { let el ; el = this . tableEl . nativeElement ; const className = 'show' ; if ( checkbox && checkbox . checked ) { el . classList . add ( className ) ; } else { el . classList . remove ( className ) ; } } }