json文件图像不会在离子页面中加载 [英] json file images won't load in ionic page

查看:118
本文介绍了json文件图像不会在离子页面中加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从服务器上的文件加载一些图像以显示在列表中。在论坛中询问后,我发现404找不到错误
,我得到请求URL错误,它看起来不在json文件中的localhost内。

I am trying to load some images from a file on a server to display on a list. I get 404 not found error after asking in forums, I get that the request URL is wrong, it looks inside the localhost not inside the json file.

https://filehost.net/db54d37849f75ddd

在代码中我有一个返回响应的服务。我在控制器和视图中使用该响应。我得到其他信息,但没有图像
如果有人有一个非常棒的解决方案。

in the code I have a service which returns a response. I use that response in a controller and to the view. I get other information but no images if anybody has a solution that would be really great.

推荐答案

请附上一些代码,通过这种方式,它更容易帮助您。关于这个问题,确实有正确形式的$ http GET请求?我的意思是你的获取请求指向服务器上的正确地址?像这样的东西
`
//简单的GET请求示例:

please attach also some code, in this way it is easier to help you. About the problem, do have correct form of $http GET request? I mean does your get request points to correct address on server? something like this ` // Simple GET request example:

$http({
  method: 'GET',
  url: '/someUrl'
}).then(function successCallback(response) {
    // this callback will be called asynchronously
    // when the response is available
  }, function errorCallback(response) {
    // called asynchronously if an error occurs
    // or server returns response with an error status.
  });

`

你可以在这里查看更多 Angular $ http

you can check more here Angular $http

这篇关于json文件图像不会在离子页面中加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆