Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (60 sloc) 2.58 KB
{% assign issue_number =[post.permalink] %}
{% raw %}
<div class="comments plain_links" ng-app="blog-comments" ng-controller="CommentsController">
<div ng-if="comments.length > 0 || isLoading">
<a ng-href="{{issueLink}}"><i class="fa fa-plus"></i> Add a comment</a> with your GitHub account
<div class="loading" ng-if="isLoading">
<i class="fa fa-spinner fa-2"></i> Loading comments...
<div ng-if="comments.length == 0 && !isLoading" class="no-comments">
No comments yet on this post. Why don't you <a ng-href="{{issueLink}}">be the first one</a>? By the way, you will need a GitHub account to comment.
<div ng-if="comments.length > 0 && !isLoading" ng-repeat="c in comments" class="comment">
<div class="comment-header">
<div class="comment-avatar">
<span class="dummy"></span>
<img ng-src="{{c.user.avatar_url}}" />
<a class="commenter" href="{{c.user.login}}">{{c.user.login}}</a>
<time datetime="{{c.created_at}}" title="{{dateTitle(c.created_at)}}">on {{c.created_at | date: "MMM dd, yyyy"}}</time>
<div class="comment-body" ng-bind-html="c.body_html | rawHtml">
{% endraw %}
<script type="text/javascript">
function CommentsController($scope, $http, $filter){
$scope.isLoading = true;
$scope.comments = [];
$scope.issueLink = "{{issue_number}}";
var apiLink = "{{issue_number}}/comments";
$scope.dateTitle = function(date){
return $filter("date")(date, "MMMM dd, yyyy '('hh:mm a 'GMT'Z')'")
function init(){
.get(apiLink, {headers: {Accept: "application/vnd.github.full+json"}})
return $filter("orderBy")(, "created_at");
$scope.isLoading = false;
$scope.comments = comments;
.module("blog-comments", [])
.controller("CommentsController", ["$scope", "$http", "$filter", CommentsController])
.filter('rawHtml', ['$sce', function($sce){
return function(val) {
return $sce.trustAsHtml(val);