Skip to content

Instantly share code, notes, and snippets.

@geelen

geelen/blog.html

Forked from benschwarz/blog.html
Created Sep 3, 2012
Embed
What would you like to do?
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