Skip to content

Instantly share code, notes, and snippets.

@adamgoose
Created October 31, 2014 17:17
Show Gist options
  • Save adamgoose/8709cb63eaaf819d667f to your computer and use it in GitHub Desktop.
Save adamgoose/8709cb63eaaf819d667f to your computer and use it in GitHub Desktop.
Template.registerHelper('favorites', function()
{
var favorites = new Favorites();
favorites.init();
return favorites;
});
var Favorites = function()
{
var favorites;
this.init = function()
{
HTTP.get('http://lovelocalbuylocal.com/api/favorites', {}, function(e, response)
{
favorites = response.data;
});
};
this.isFavorite = function(business)
{
return true;
};
};
<span class="icon {{#if favorites.isFavorite business}}icon-star-filled{{else}}icon-star{{/if}} pull-right" id="favoriteIcon"></span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment