File

src/app/shared/pipes/first-upper.pipe.ts

Description

Uppercase the first letter of the string

Usage : value | firstUpper:exponent

Example : {{ car | firstUpper}} formats to: Car

Metadata

Methods

transform
transform(value, args)
Parameters :
Name Optional
value No
args No
Returns : any

First upper pipe

import { PipeTransform, Pipe } from '@angular/core';

/**
 * Uppercase the first letter of the string
 *
 * __Usage :__
 *   value | firstUpper:exponent
 *
 * __Example :__
 *   {{ car |  firstUpper}}
 *   formats to: Car
 */
@Pipe({
    name: 'firstUpper'
})
export class FirstUpperPipe implements PipeTransform {
    transform(value, args) {
        return value.charAt(0).toUpperCase() + value.slice(1);
    }
}

results matching ""

    No results matching ""