Howdy,
Sorry for the most likely very noob question as I’m very new to Phoenix and programming in general but I’ve been trawling through Hexdocs and came across: Phoenix.LiveView.JS — Phoenix LiveView v0.17.11
I get the general principles and have no issues following the guide in terms of what the different JS. commands actually do, however I’m struggling immensely with seeing them in action which I assume is due to lack of knowledge of the structure of Phoenix.
My original assumption was that the functions are defined in the js.ex file and that you can upon them within .heex files with examples like the ones shown in Hexdocs.
If I copy one of the examples to my test projects .heex files, Liveview comes up with an error stating ‘(module JS is not available)’.
Sorry again if it’s totally obvious, but would someone be able to explain to me or point me in the right direction on how to get JS. commands to work in LiveView?
Pretty sure all I need is one solid example of what goes where and I can figure the rest out from there.
Thanks