import { Injectable } from '@angular/core' ; import { PrStatistics } from '@pimp-my-pr/shared/domain' ; @ Injectable ( ) export class TableReviewerStatisticsPresenter { public sortData ( item , property ) { switch ( property ) { case 'author' : return item . author . name ; case 'comments' : return item . commentsCount ; case 'reviewers' : return item . reviewers . length ; default : return item [ property ] ; } } }