나는 agular js를 배우려고 노력 중이며 사용자의 github repos를 얻기 위해 첫 번째 코드 샘플을 시작했습니다.ng-repeat가 행을 표시하지 않습니다.
<!DOCTYPE html>
<html ng-app="githubViewer">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.css" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js"></script>
<script src="script.js"></script>
</head>
<body ng-controller="gitHubRepoController">
{{error}}
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Full Name</th>
<th>HTML Url</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="repo in repos">
<td>{{repo.name}}</td>
<td>{{repo.full_name}}</td>
<td>{{repo.html_url}}</td>
<td>{{repo.description}}</td>
</tr>
</tbody>
</table>
</body>
</html>
내 제어기 some value
{{error}}
를 도시 된 바와 같이 로딩이
(function() {
var app = angular.module("githubViewer",[]);
var gitHubRepoController = function($scope, $http){
$http.get("https://api.github.com/users/lakshman553/repos")
.then(onDataDownloaded, onError);
var onDataDownloaded = function(response) {
console.log(response.data);
$scope.repos = response.data;
};
$scope.error = "some value";
var onError = function(reason) {
$scope.error = reason;
};
};
app.controller("gitHubRepoController",gitHubRepoController);
})();
각도 JS 같다 :
내 HTML 페이지 이렇
테이블 헤더가 제대로로드되었지만 그 밖의 것은 표시되지 않습니다. broswer에서 보았을 때도 URL이 데이터를 반환합니다.
콘솔에도 오류가 없습니다.
어디로 가고 있습니까?
fiddle 또는 plunkr에서이 문제를 설정할 수 있습니까? – master565
response.data가 데이터를 반환하는 경우 콘솔에서 체크인 했습니까? – gaurav5430
{{repos.length}}를 인쇄하면 무엇을 얻게됩니까? –