我希望能够使用Angular.js(用于ionic-framework)将从服务器获取的图像数据转换,我已经使用了以下代码:
$http.post(link, {
token: token,
reservationCode: reservationCode
}).success(function (res){
$scope.image = btoa(unescape(encodeURIComponent(res)));
}).error(function (data) {
return false;
});
并在我的 HTML 中使用以下代码:
<img src="data:image/png;base64,{{image}}">
但是这个错误总是显示:
GET data:image/png;base64,{{image}} net::ERR_INVALID_URL
有人可以帮忙吗?