New Angular UI from 1806
[vid.git] / vid-webpack-master / src / app / shared / pipes / capitalize / capitalize-and-format.pipe.ts
1 import {PipeTransform, Pipe} from '@angular/core';
2
3 @Pipe({ name: 'capitalizeAndFormat' })
4 export class CapitalizeAndFormatPipe implements PipeTransform {
5   transform(text: string): string {
6     if (text) {
7       text = text.toLowerCase().replace('_', '-');
8       return text.charAt(0).toUpperCase() + text.slice(1);
9     }
10     return text;
11   }
12 }