Elixir expressions in javascript

Can elixir expressions be evaluated inside javascript in a phoenix template?

1 Like

You might need to show an example of what you mean exactly.

1 Like

How can I get the javascript variable into the elix expression?

What are you trying to achieve? It sounds like you are trying to get Elixir / Javascript interop going, but depending on what you are trying to achieve there is likely a better pattern than evaluating expressions written in one language within the runtime of another.

4 Likes

Thanks for the reply. I agree with your assessment. I am trying an api scope in the router and JSON.