QR code from base64 encoded string Angular 2

I have variable with base64 encoded string and I would like to decode it and after that, displayed it in a HTML template. I am using Angular 2 with typescript.

So I am looking for some base64 encode/decode library for Angular2/Typescript and some options to create an image from decoded string.

Thanks

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

I solved it with something like this:

this.QRCode = "data:image/png;base64," + base64EncodedQRCodeInString;

this.QRCode is mapped to template by property binding, for example <img [src]="QRCode" />, it is not neccessary to decode it from base64. The browsers have the full support for base64 encoded strings.