app/@overflow/commons/ui/pipe/string-prettify.ts

10 lines
315 B
TypeScript
Raw Normal View History

2018-09-12 02:53:28 +00:00
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);
}
}