pipa sudut huruf besar
{{ value_expression | uppercase }}
joy Dolphin
{{ value_expression | uppercase }}
{{ value_expression | titlecase }}
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);
}
}