Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 使用angularJs调用Django rest api时没有输出结果_Html_Angularjs - Fatal编程技术网

Html 使用angularJs调用Django rest api时没有输出结果

Html 使用angularJs调用Django rest api时没有输出结果,html,angularjs,Html,Angularjs,2台服务器正在运行我的机器。第一个是django服务器,使用Ip和端口(例如:)运行。当我导航到该url时,将显示Api。第二台服务器是apache,使用localhost(例如:)运行。我在本地主机上使用angularJs调用django rest api。但我什么也没有得到,即使在开发工具中也没有错误显示。请检查下面的代码并给我一些有价值的建议 var myApp=angular.module(“myModule”,[]); var getData=function($scope,$htt

2台服务器正在运行我的机器。第一个是django服务器,使用Ip和端口(例如:)运行。当我导航到该url时,将显示Api。第二台服务器是apache,使用localhost(例如:)运行。我在本地主机上使用angularJs调用django rest api。但我什么也没有得到,即使在开发工具中也没有错误显示。请检查下面的代码并给我一些有价值的建议

var myApp=angular.module(“myModule”,[]);
var getData=function($scope,$http){
变量url=”http://IpNumber:5050/ids";
$http.jsonp(url)
.then(功能(数据){
$scope.emps=data.data;
});
}
myApp.controller('getData',getData)

{{emps}}

您是否在控制台中看到任何错误?你在90号港吗?抱歉耽搁了。现在是印度的夜晚。我登录了浏览器控制台。没有显示任何错误。在django中,我使用了CORS_ORIGIN_ALLOW_ALL=True。我不知道如何启用CORS客户端。请引导我。