Skip to content

Instantly share code, notes, and snippets.

@timlevett
Created May 7, 2015 15:46
Show Gist options
  • Save timlevett/1976091e6793ae71fdc0 to your computer and use it in GitHub Desktop.
Save timlevett/1976091e6793ae71fdc0 to your computer and use it in GitHub Desktop.
Widget template for a subreddit
<div class='scroll-widget' ng-init='lim=3'>
<loading-gif data-object='content' data-empty='isEmpty'></loading-gif>
<div ng-if='isEmpty'>Issue loading reddit feed, click launch button to get feed.</div>
<ul class='widget-list' style='padding : 0'>
<li ng-repeat='item in content.data.children | limitTo:lim'>
<a href='{{item.data.url}}' target='_blank'>
<p class='bold'>{{item.data.title}}<span class='right'>score: {{item.data.score}}</span></p>
<p>{{item.data.selftext}}</p>
</a>
</li>
<li class='center' ng-hide='content.data.children.length <= lim' ng-click='lim=lim+5'><button class='btn btn-flat center'>Load More</button></li>
</ul>
</div>
<a class='btn btn-default launch-app-button' href='https://www.reddit.com/r/uwmadison' target='_blank'>Launch UW subreddit</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment