We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying access the global scope from this function:
// js <% write = (input) -> %> <div class="translated"><%- @translate input %></div> <% end %> <%- write 'hello' %>
// data { translate: function(input){ return: 'hello world' } }
but I get this Error:
Cannot call method 'translate' of undefined in page on line 2
The text was updated successfully, but these errors were encountered:
You can manually pass this object to custom function if it really needed:
this
<%- write.call @, 'hello' %>
ECT doesn't change the behavior of inline created functions by default.
Sorry, something went wrong.
There is another, more beautiful way, to save this context:
<% write = (input) => %> <div class="translated"><%- @translate input %></div> <% end %> <%- write 'hello' %>
Use => instead of ->
=>
->
No branches or pull requests
I'm trying access the global scope from this function:
but I get this Error:
The text was updated successfully, but these errors were encountered: