I have a base 64 encoded string, I want to display it on my angular template file.
Asked
Active
Viewed 2,213 times
-2
-
You want to render `base64` string as image, right? – Plochie Dec 27 '19 at 11:49
-
Yes, I want to do – vijesh Dec 27 '19 at 11:51
-
do you have sample data? – Plochie Dec 27 '19 at 11:52
-
Also, the `base64` string, is it image (jpg, png) or pdf file? – Plochie Dec 27 '19 at 11:55
-
To render image you can set the src property of the "img" tag. – Fedor Patutinskiy Dec 27 '19 at 12:59
1 Answers
0
Try
<img [src]="yourEncodedStringVariable"/>
where yourEncodedStringVariable= data:image/png;base64,[your base 64 string]

Fedor Patutinskiy
- 123
- 9