Use liquid filter in JavaScript
maxfrigge opened this issue · comments
Is there a way to apply a filter outside of a template?
There are certain occasions where this could be useful.
var result = Liquid.applyFilter(myVar, "capitalize");
Haven't tested this, but in theory you should be able to do this:
Liquid.Strainer.filters.capitalize( myVar )
A more official API for accessing those might be nice.
It works... thanks!