Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular capitalize pipe

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);
  }
}
Source by angular.io #
 
PREVIOUS NEXT
Tagged: #angular #capitalize #pipe
ADD COMMENT
Topic
Name
3+7 =