File

src/app/manage-learn/shared/pipe/camel-to-title.pipe.ts

Metadata

Methods

transform
transform(value: any, ...args: [])
Parameters :
Name Type Optional
value any No
args [] No
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'camelToTitle'
})
export class CamelToTitlePipe implements PipeTransform {

  transform(value: any, ...args: unknown[]): unknown {
    let newStr = value.replace(/([A-Z])/g, " $1");
    return newStr.charAt(0).toUpperCase() + newStr.slice(1);
  }

}

results matching ""

    No results matching ""