Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use liquid filter in JavaScript #44

Open
maxfrigge opened this issue Jun 24, 2015 · 2 comments
Open

Use liquid filter in JavaScript #44

maxfrigge opened this issue Jun 24, 2015 · 2 comments

Comments

@maxfrigge
Copy link

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");

@mattmccray
Copy link
Owner

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.

@maxfrigge
Copy link
Author

It works... thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants