import { Pipe , PipeTransform } from '@angular/core' ; @ Pipe ( { name : 'initCaps' } ) export class InitCapsPipe implements PipeTransform { transform ( value , args ? ) { return value . toLowerCase ( ) . replace ( /(?:^|\s)[a-z]/g , m => m . toUpperCase ( ) ) ; } }