projects/maplander/components/src/lib/pipes/offering-type/offering-type.pipe.ts
Name | offeringType |
transform | |||||||||
transform(value: OfferingTypeEnum, prefix?: string)
|
|||||||||
Parameters :
Returns :
string
|
import {Pipe, PipeTransform} from '@angular/core';
import {OfferingTypeEnum} from '@maplander/types';
import {ConstantsComponents} from '../../constantsComponents';
@Pipe({
name: 'offeringType'
})
export class OfferingTypePipe implements PipeTransform {
transform(value: OfferingTypeEnum, prefix?: string): string {
let response = prefix ? prefix : 'en';
ConstantsComponents.OfferingTypeList.forEach(type => {
if (type.value === value) {
response += ` ${type.name.toLowerCase()}`;
}
});
return response;
}
}