@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?