为了账号安全,请及时绑定邮箱和手机立即绑定

AngularJS怎么实现跨域取数据

AngularJS怎么实现跨域取数据

30秒到达战场 2018-09-07 13:09:11
<!DOCTYPE html><html><head><meta charset="utf-8"><script src="http://cdn.static.runoob.com/...</head><body><div ng-app="myApp" ng-controller="customersCtrl"><ul><li ng-repeat="x in names">{{ x.Name + ', ' + x.Country }}</li></ul></div><script>var app = angular.module('myApp', []);app.controller('customersCtrl', function($scope, $http) {$http.get("http://www.runoob.com/try/angularjs/data/Customers_JSON.php").success(function (response) {$scope.names = response.records;});});</script></body></html>
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 789 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号