angular-img-http-src

Fetch images via $http and set src to a Blob URL


Keywords
angular, img, http, token-based-auth
License
MIT
Install
bower install angular-img-http-src

Documentation

angular-img-http-src

Status: Go horse.

Problem

You used token based auth and you need to serve images from secured routes.

Solution

Use http-src instead of ng-src and it will fetch images using the $http service - meaning Authorization headers added via interceptors will be present - then build a Blob and set the src to an objectURL.