Last active
December 30, 2015 19:39
-
-
Save adamblank/7875176 to your computer and use it in GitHub Desktop.
Add a compile method to underscore, to accommodate for typeahead's expected API
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
_.compile = function(templ) { | |
var compiled = this.template(templ); | |
compiled.render = function(ctx) { | |
return this(ctx); | |
}; | |
return compiled; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment