src/app/shared/pipes/first-upper.pipe.ts
Uppercase the first letter of the string
Usage : value | firstUpper:exponent
Example : {{ car | firstUpper}} formats to: Car
Name | firstUpper |
transform | ||||||
transform(value, args)
|
||||||
Defined in src/app/shared/pipes/first-upper.pipe.ts:17
|
||||||
Parameters :
Returns :
any
|
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);
}
}