Created
October 31, 2014 17:17
-
-
Save adamgoose/8709cb63eaaf819d667f to your computer and use it in GitHub Desktop.
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
Template.registerHelper('favorites', function() | |
{ | |
var favorites = new Favorites(); | |
favorites.init(); | |
return favorites; | |
}); |
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
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; | |
}; | |
}; |
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
<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