Skip to content

Instantly share code, notes, and snippets.

@piranna
Forked from formula1/blog.html
Last active August 29, 2015 14:15
Show Gist options
  • Save piranna/5b40a7afff28752262fe to your computer and use it in GitHub Desktop.
Save piranna/5b40a7afff28752262fe to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.min.js"></script>
<script type="text/javascript">
var path = "/NodeOS/NodeOS/issues";
</script>
</head>
<body>
<h1>NodeOS Blog</h1>
<section ng-app="NodeOsBlog" ng-controller="BlogListCtrl" id="articles">
<article ng-repeat="item in blog">
<header class="{{item.state}}">
<a href="https://github.com{{path+'/'+item.number}}"><h3 class="title">{{item.title}}</h3></a>
</header>
<pre class="content">{{item.body}}</pre>
<footer>
<a href="https://github.com{{path+'/'+item.number}}" class="comments">
There are {{item.comments}} comments.
</a>
</footer>
</article>
</section>
<script type="text/javascript">
var $articles = void(0);
var NodeOsBlog = angular.module('NodeOsBlog', []);
NodeOsBlog.controller('BlogListCtrl', function ($scope, $http) {
$http.get('https://api.github.com/repos'+path+'?labels=blog')
.success(function(data) {
$scope.path = path;
$scope.blog = data;
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment