I’m pretty new to adonis and I’m struggling to find how to call a function (ideally from my controller) on button click in my view?
I believe you are mixing frontend runtime and backend runtime.
Adonis ran in the backend. What you are asking is to listen to a frontend event, which is not doable on Adonis.
There’s multiple solution for that:
- Your “button” is in fact a link that will reach your application endpoint.
Thanks for that clarification @romain.lanz. Much appreciated.