Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
81 lines (67 sloc) 2.64 KB
<!doctype html>
<html ng-app>
<script src=""></script>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html">
<title>Github API Webapp using AngularJS - Not So Clever Demo</title>
<link rel="stylesheet" type="text/css" media="all" href="css/styles.css">
<body ng-controller="GitHubCtrl">
<div id="w">
<h1>Simple Github API Webapp</h1>
<p>Enter a single Github username below and click the button to display profile info.</p>
<input type="text" id="ghusername" ng-model="username" placeholder="Github username...">
<a href="#" id="ghsubmitbtn" ng-click="getGitInfo()">Pull User Data</a>
<div id="ghapidata" class="clearfix"></div>
<div ng-show="userNotFound">
<h2>No User Info Found</h2>
<div ng-show="loaded">
<h2> {{}}
<span class="smallname">(@<a href="{{user.html_url}}" target="_blank"> {{user.login}} </a>)</span>
<div class="ghcontent">
<div class="avi">
<a href="{{ user.html_url }}" target="_blank">
<img src="{{ user.avatar_url }}" width="80" height="80" alt="{{ user.login }}"></a>
Followers: {{ user.followers }} - Following: {{ user.following }}<br>Repos: {{ user.public_repos }}</p>
<div class="repolist clearfix">
<p ng-hide="reposFound">No repos!</p>
<div ng-show="reposFound">
<p><strong>Repos List:</strong></p>
<ul ng-repeat="repo in repos">
<li><a href="{{repo.html_url}}" target="_blank"> {{}} </a></li>
<a href=""></a>
function GitHubCtrl($scope, $http) {
$scope.getGitInfo = function () {
$scope.userNotFound = false;
$scope.loaded = false;
$http.get("" + $scope.username)
.success(function (data) {
if ( == "") = data.login;
$scope.user = data;
$scope.loaded = true;
.error(function () {
$scope.userNotFound = true;
$http.get("" + $scope.username + "/repos").success(function (data) {
$scope.repos = data;
$scope.reposFound = data.length > 0;