I'm honestly not sure why they didn't do this out of the box.
Object.extend(String.prototype, { mixin: function(obj) { return new Template(this).evaluate(obj); } });
Oh, yes.
"#{company} forever!".mixin({company: 'Unspace'}) // Unspace forever!
12374 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Object.extend(String.prototype, { mixin: function(obj) { return new Template(this).evaluate(obj); } });
"#{company} forever!".mixin({company: 'Unspace'}) // Unspace forever!
You need to create an account or log in to post comments to this site.