Created
July 19, 2013 15:52
-
-
Save Jwpe/6040220 to your computer and use it in GitHub Desktop.
A small Handlebars helper for checking that an item is not null or Undefined before rendering a block. Inspired by https://github.com/elving/swag/
This file contains 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
Handlebars.registerHelper 'exists', (value, options) -> | |
if value? then options.fn(@) else options.inverse(@) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment