src/app/shared/pipes/health-color.pipe.ts
Name | healthColor |
transform | ||||||
transform(value: any)
|
||||||
Defined in src/app/shared/pipes/health-color.pipe.ts:7
|
||||||
Parameters :
Returns :
any
|
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'healthColor'
})
export class HealthColorPipe implements PipeTransform {
transform(value: any): any {
if (value === 'HEALTH_OK') {
return { color: '#00bb00' };
} else if (value === 'HEALTH_WARN') {
return { color: '#ffa500' };
} else if (value === 'HEALTH_ERR') {
return { color: '#ff0000' };
} else {
return null;
}
}
}