projects/i-components/src/lib/pipes/applyconversion.pipe.ts
Pipe for applying a conversion for simple values
Name | applyConversion |
Pure | true |
transform | |||||||||
transform(value: any, ...args: any[])
|
|||||||||
Parameters :
Returns :
any
|
import { Pipe, PipeTransform } from '@angular/core';
/**
* Pipe for applying a conversion for simple values
*
* @export
* @class ApplyConversionPurePipe
* @implements {PipeTransform}
*/
@Pipe({
name: 'applyConversion',
pure: true,
})
export class ApplyConversionPurePipe implements PipeTransform {
transform(value: any, ...args: any[]): any {
if (typeof args[0] !== 'undefined') {
return args[0](value);
} else {
return value;
}
}
}