Thanks! While what you suggested works, I was trying to download an image,
keep in local storage, and display it on many views as it is a profile
image.
In other words, I am trying to avoid multiple downloads of an image (though
cache can avoid it).
On Friday, September 11, 2015 at 11:47:13 AM UTC+5:30, Sander Elias wrote:
>
> Hi Manjunath,
>
> One question pops to my mind directly, why not:
> <img ng-src={{scopeVarWithUrlInIt}}>
>
> ??
>
> The second thing I noticed that your downloadURl returns a promise, so you
> should receive it's data in a then callback like this:
> image_data = downloadFileFromUrl(URL).then(function (image_data) {
> $scope.img = 'data:image/jpg;base64,' + $base64.encode(image_data);
> $scope.img = 'data:image/jpg;base64,' + btoa(image_data);
> $scope.img = 'data:image/jpg;base64,' + btoa(unescape(
> encodeURIComponent(image_data)));
> })
>
>
> Hope this helps you a bit,
> Regards
> Sander
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.