app/@overflow/commons/ui/pipe/string-prettify.ts
2018-09-12 11:53:28 +09:00

10 lines
315 B
TypeScript

import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'stringPrettify' })
export class stringPrettify implements PipeTransform {
transform(value: string): any {
value = value.replace('-', ' ');
value = value.replace('_', ' ');
return value.charAt(0).toUpperCase() + value.slice(1);
}
}