src/lib/pipes/split-initials/split-initials.pipe.ts
Name | splitInitials |
transform | ||||||
transform(value: string)
|
||||||
Parameters :
Returns :
any
|
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'splitInitials'
})
export class SplitInitialsPipe implements PipeTransform {
transform(value: string): any {
if (value) {
let userInitial = '';
const name = value.split(' ');
name.forEach(element => {
userInitial = userInitial + element.charAt(0);
});
return userInitial;
}
}
}