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

how to execute javascript inside template without helpers ? #1164

Closed
alsemany opened this issue Dec 27, 2015 · 1 comment
Closed

how to execute javascript inside template without helpers ? #1164

alsemany opened this issue Dec 27, 2015 · 1 comment

Comments

@alsemany
Copy link

Hello,
is there a way to execute javascript inside the template ?
I'm used EJS before and I'm new to HBS , in EJS I can easily use

<% var foo = 'bar'; %>
then inserting it easily
<%= foo %>

is there any feature to do this with Handlebars something like that
{{code}}
var foo = 'bar';
{{/code}}
then
{{foo}}

@kpdecker
Copy link
Collaborator

The language was explicitly designed to avoid this. If you need anything with side effects then you'll need to design your own system with helpers.

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