how to convert byte array to image in Angular2

2019-06-10 22:34发布

I am getting byte array from api and i have applied image tag on my HTML page as <img src="data:{{model.asd_logo_type}};base64,{{model.dfgh_logo}}" alt="...">

but i am not able to get the image on display.

Please suggest what can i do.

1条回答
走好不送
2楼-- · 2019-06-10 23:11

you can use src directive to display image in angular

<img [src]="'data:image/jpeg;base64,'+model.dfgh_logo" />

This is how I achieved. model.dfgh_logo this should have image in byte array.

查看更多
登录 后发表回答