我是angularjs的新手.我正在尝试发出需要授权的API请求.我已将它包含在请求的标题中,但它仍然无法正常工作.我确信我的访问令牌正在运行.有什么建议?
$scope.fetch = function() {
$scope.code = null;
$scope.response = null;
$http({
method: $scope.method,
url: $scope.url,
cache: $templateCache,
headers: {
Authorization: "access token"
}
}).
success(function(data, status) {
$scope.status = status;
$scope.data = data;
}).
error(function(data, status) {
$scope.data = data || "Request failed";
$scope.status = status;
});
};
Run Code Online (Sandbox Code Playgroud) 我正在发出一个http请求,它返回一个图像的URL.我想在我的html页面中显示图像.有没有办法做到这一点?我想要做的是(这不起作用但是......)img src = {{result.imageurl}}