Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.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
Javascript 带有AngularJS的复杂JSON响应_Javascript_Json_Angularjs_Html_Web Services - Fatal编程技术网

Javascript 带有AngularJS的复杂JSON响应

Javascript 带有AngularJS的复杂JSON响应,javascript,json,angularjs,html,web-services,Javascript,Json,Angularjs,Html,Web Services,我一直在通过w3schools和其他网站慢慢地自学angularjs,我正在尝试下载和解释一些json。我已经用一个非常基本的jsonurl()成功地做到了这一点,但是在一个更复杂的响应中,我在破译层时遇到了困难 谁能帮我一下吗。我已将代码放入“粘贴箱”,因为我的浏览器很难在此处为您正确显示代码:/ 我点击的JSON url在这里 干杯 编辑:根据反馈和帮助添加代码。为了回答其他问题,我以版权url为例。其中一个可重复的是“空气温度” <!DOCTYPE html> <ht

我一直在通过w3schools和其他网站慢慢地自学angularjs,我正在尝试下载和解释一些json。我已经用一个非常基本的jsonurl()成功地做到了这一点,但是在一个更复杂的响应中,我在破译层时遇到了困难

谁能帮我一下吗。我已将代码放入“粘贴箱”,因为我的浏览器很难在此处为您正确显示代码:/

我点击的JSON url在这里

干杯

编辑:根据反馈和帮助添加代码。为了回答其他问题,我以版权url为例。其中一个可重复的是“空气温度”

<!DOCTYPE html>
<html>

<head>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
</head>

<body>

<div ng-app="" ng-controller="customersController">

<ul>
  <li ng-repeat="x in names">
    {{ names.observations.copyright_url }}
  </li>
</ul>




</div>

<script>
function customersController($scope,$http) {
  $http.get("http://www.bom.gov.au/fwo/IDN60901/IDN60901.95764.json")
  .success(function(data) {$scope.names = data;});

}
</script>

</body>
</html>

  • {{names.observations.copyright_url}
函数customersController($scope,$http){ $http.get(“http://www.bom.gov.au/fwo/IDN60901/IDN60901.95764.json") .success(函数(数据){$scope.names=data;}); }
ng repeat
标签需要更正

试试下面

<ul>
  <li ng-repeat="x in names.observations.notice">
      {{x.copyright_url}}
  </li>
  <li ng-repeat="x in names.observations.header">
      {{x.product_name}}
  </li>
  <li ng-repeat="x in names.observations.data">
      {{x.name}}
  </li>
</ul>
  • {{x.copyright_url}
  • {{x.product_name}
  • {{x.name}

json的实际用途是什么?把所有的都写出来?从json来看,只有一个版权url,所以重复没有意义将代码粘贴到问题上,突出显示它,然后单击工具栏上的“代码”按钮(看起来像
{}
),我现在已经粘贴了代码,感谢您的帮助。谢谢您的帮助,但这似乎没有修复它。还是一片空白。我已经检查过了,我得到了一个成功的json响应,并且我已经调整了答案以使用给定的json。