크리켓 경기 정보와 관련된 애플리케이션을 생성 중입니다. API 응답을 가져 오는 중 문제가 발생했습니다. 당신은 API 응답 here를 확인할 수 있습니다. 콘솔 오류를 보여주고, 확인하시기 바랍니다 여기에각도로 API 데이터 가져 오기
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container" ng-app="cricApp" ng-controller="cricCtrl">
<div class="form-group">
<h2>Your result</h2>
<table class="table table-striped">
<thead>
<tr><th colspan="4"><h4>Cricket Match Info</h4></th></tr>
<tr>
<th>Sno</th>
<th>unique_id</th>
<th>description</th>
<th>title</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="match in matchList | filter: nameFilter">
<td>{{$index + 1}}</td>
<td>
{{match.unique_id}}
</td>
<td>{{match.description}}</td>
<td>{{match.title}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js"></script>
<script>
angular.module('cricApp', []).
controller('cricCtrl', function($scope, $http) {
$scope.matchList = [];
$http.get("http://cricapi.com/api/cricket").then(function (response) {
console.log(response);
$scope.matchList = response.data;
});
}
);
</script>
</body>
</html>
'console.log (응답); 응답을 게시 할 수 있습니까? –
도착하는 오류 메시지의 첫 번째 줄에 URL ('http : //errors.angularjs ....')이 표시됩니다. 해당 URL을 클릭하면 오류에 대한 정보가 표시되지 않습니다. –
에서 필터를 제거하고 시도하십시오 –