My ng-repeat function is not returning anything, and as a beginner in Angular, I am struggling to identify the error. Despite thorough error checking, I can't seem to figure out what's going wrong here.
(function() {
var app = angular.module("testApp", []);
app.controller("MainController", function($scope, $http) {
$scope.search = function(username) {
$http.get("https://api.github.com/users/" + username)
.then(onUserComplete, onError);
$http.get($scope.user.repos)
.then(onRepos, onReposError);
};
var onUserComplete = function(response) {
$scope.user = response.data;
};
var onRepos = function(response) {
$scope.repos = reponse.data;
};
});
}());
Below is the HTML code where I intended to display the repositories of specific users on GitHub:
<table>
<thead>
<tr>
<th>Name</th>
<th>Stars</th>
<th>Language</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="repo in repos">
<td>{{repo.name}}</td>
<td>{{repo.stargazers_count }}</td>
<td>{{repo.language}}</td>
</tr>
</tbody>
</table>