Skip to content

Instantly share code, notes, and snippets.

@cullymason
Created October 7, 2013 18:14
Show Gist options
  • Save cullymason/6872469 to your computer and use it in GitHub Desktop.
Save cullymason/6872469 to your computer and use it in GitHub Desktop.
A simple Handlebars helper for using bootstrap icons icons. Simple but useful.
Ember.Handlebars.registerBoundHelper('icon', function(iconName) {
iconName = iconName.toString();
return new Handlebars.SafeString("<span class='glyphicon glyphicon-"+iconName+"'></span>");
});
{{icon "star"}}
{{!--
This would return:
<span class="glyphicon glyphicon-star"></span>
--}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment