{{ value_expression | uppercase }}
transform(value:string): string {
let first = value.substr(0,1).toUpperCase();
return first + value.substr(1);
}
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'capitalize'
})
export class CapitalizePipe implements PipeTransform {
transform(value: string, ...args: string[]): string {
return value.toLowerCase().charAt(0).toUpperCase() + value.toLowerCase().slice(1);
}
}