-
-
Save geelen/3606528 to your computer and use it in GitHub Desktop.
BYO tumblr.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="blog" ng-controller="FeedCtrl"> | |
<span ng-hide="posts">Loading</span> | |
<article ng-repeat="post in posts"> | |
<h1 class="title">{{ post.title }}</h1> | |
<time class="publishedDate">{{ post.publishedDate }}</time> | |
<div class="content">{{ post.content }}</div> | |
</article> | |
</div> | |
<script src="//cloudjs.org/angular-min-1.0.1.js"></script> | |
<script src="http://www.google.com/jsapi"></script> | |
<script> | |
var FeedCtrl = function($scope) { | |
google.load( 'feeds', '1' ); | |
google.setOnLoadCallback( function() { | |
var feed = new google.feeds.Feed( feedURL ); | |
feed.setNumEntries( postsPerPage ); | |
feed.load( function(response) { | |
$scope.posts = response.feed.entries | |
$scope.$apply() //tell Angular there's new data | |
}); | |
}); | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment