Skip to content
Advertisement

Converting an Image url to base64 in Angular

I am struggling trying to convert a given image url to base64… in my case i have a String with the image’s path

JavaScript

how can i convert the given image url in a base64 directly?… i tried this post.

Converting an image to base64 in angular 2

but this post is getting the image from a form… how can i adapt it?

Advertisement

Answer

You can use this to get base64 image

JavaScript

Then call it like this

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement