-
-
Save jimbog/e4452a9d125f9e6e958d to your computer and use it in GitHub Desktop.
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
UI.registerHelper('_', function() { | |
arguments = _.toArray(arguments); | |
var self = this, | |
fn = arguments[0]; | |
arguments.shift(); // Removes the Underscore function | |
arguments.pop(); // Remove the Spacebars appended argument | |
return _[fn].apply(self, arguments); | |
}); | |
/* | |
Example: | |
{{#if _ "isString" "bonjour"}} | |
It is! | |
{{else}} | |
It is not :( | |
{{/if}} | |
Would return "It is!" | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment