File

projects/maplander/components/src/lib/pipes/offering-type/offering-type.pipe.ts

Metadata

Name offeringType

Methods

transform
transform(value: OfferingTypeEnum, prefix?: string)
Parameters :
Name Type Optional
value OfferingTypeEnum No
prefix string Yes
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;
  }

}

result-matching ""

    No results matching ""