@Pipe({ name: 'shortSex' })
export class SexPipe implements PipeTransform {
  public transform(value: any): 'M' | 'K' {
    switch (value?.code) {
      case SexCodes.MALE:
        return 'M';
      case SexCodes.FEMALE:
        return 'K';
      default:
        return null;
    }
  }
}

What can I say more?

By Anonymous, 2021-07-21 10:44:17