Skip to content

Instantly share code, notes, and snippets.

@geelen
Forked from benschwarz/blog.html
Created September 3, 2012 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geelen/3606528 to your computer and use it in GitHub Desktop.
Save geelen/3606528 to your computer and use it in GitHub Desktop.
BYO tumblr.
<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