import { Component , OnInit , Input , Output , EventEmitter , ChangeDetectionStrategy } from '@angular/core' ; @ Component ( { selector : 'app-users-list' , templateUrl : './users-list.component.html' , styleUrls : [ './users-list.component.scss' ] , changeDetection : ChangeDetectionStrategy . OnPush } ) export class UsersListComponent implements OnInit { @ Input ( ) users : any [ ] ; @ Output ( ) userSelected = new EventEmitter < any > ( ) ; @ Output ( ) addAdmin = new EventEmitter < any > ( ) ; @ Output ( ) removeAdmin = new EventEmitter < any > ( ) ; constructor ( ) { } ngOnInit ( ) { } onUserSelected ( user ) { this . userSelected . emit ( user ) ; } onAddAdmin ( user ) { this . addAdmin . emit ( user ) ; } onRemoveAdmin ( user ) { this . removeAdmin . emit ( user ) ; } trackByFn ( index ) { return index ; } }