Pulse7
9/8/2017 - 7:57 PM

ng-repeat

<form>
  <input type="text" ng-model="username">
  <input type="submit" ng-click="search(username)" value="Search">
</form>
<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>
=================
var onRepos = function(response){
            $scope.repos = response.data;
        }
var onUserComplete = function (response) {
            $scope.user = response.data;
            $http.get($scope.user.repos_url)
                .then(onRepos);

        }
$scope.search = (username) => {
            $http.get("http://api.github.com/users/" + username)
                .then(onUserComplete);
        };
        

<ul>
    <li ng-repeat="user in users">{{user}}</li>
</ul>