HaithemMosbahi/ngx-avatar

Displays the first and last character avatars of the name?

vandinhabc opened this issue · 2 comments

Displays the first and last character avatars of the name?

i have name avatar = 'nguyen van dinh', i want display avatar : ND and i have name = 'admin', i want display 'AD'. help me? thank

I believe this is a specific transformation that you can do outside of avatar component and then just simply pass the value that you wanna display to the avatar component. e.g :

<ngx-avatar value="AD"></ngx-avatar>

<ngx-avatar [value]="adminAvatar"></ngx-avatar> 
// in your component ts: adminAvatar = 'AD' or maybe a pipe that will return avatar based on the value and type,
if admin returns 'AD', if with middle name return ND, etc