net :: ERR_CONNECTION_REFUSED离子 [英] net::ERR_CONNECTION_REFUSED ionic

查看:6282
本文介绍了net :: ERR_CONNECTION_REFUSED离子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用离子开发应用程序,我可以从我的webApi服务器检索数据并使用 ionic serve 在导航器上显示它们但是当我尝试执行它时模拟器:离子运行android -l -c 我收到此错误: net :: ERR_CONNECTION_REFUSED

I'm developing an application using ionic , I could retrieve data from my webApi server and display them on the navigator with ionic serve but when I try to execute it on the emulator:ionic run android -l -c i get this error :net::ERR_CONNECTION_REFUSED

奇怪的是 $ scope 包含所需的数据,我可以记录它们。

What is strange is that the $scope contains the required data and I could log them .

推荐答案

Android设备/模拟器上的localhost很可能无法解析到您的开发机器/服务器的IP。 Localhost可能指向设备/模拟器本身。你能不能点击机器的实际IP地址?或者你可以在云端的某个地方托管网络服务并试试吗?

More than likely localhost on the Android device/emulator does not resolve to the IP of your development machine/server. Localhost probably points to the device/emulator itself. Can you hit the actual IP Address of your machine instead? Or can you host the web service somewhere in the cloud and try that?

谢谢,
Dan

Thanks, Dan

这篇关于net :: ERR_CONNECTION_REFUSED离子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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