-
Notifications
You must be signed in to change notification settings - Fork 641
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
Is there anyway to embed native javascript in template? #419
Comments
You always have at least 4 options:
In your case you need anyway to map that constructor to filter, global variable or pass it as data. |
If you want that you just need to use EJS. Nunjucks is not JS, even if it looks like a subset sometimes. Thanks for the detailed reply @ArmorDarks ! |
Nunjucks have a lot build in filters, they do great help to writing templates.
But if we want more flexibility from native javascript language, how to do it with Nunjucks?
EJS and JSP have such feature.
For example, I want to show current date. I can't do it with something like {{ Date.now() }}
The text was updated successfully, but these errors were encountered: