ahv.javier
Multiple values on phx-click phx-value- not being assigned to handle_event
I want to send multiple values using the phx-click, I was going to send all the values in the same phx-value as string separating the values with : .. Then I found the new documentation stating that it is possible to send multiple values using phx-value-valuename and receiving the values in the handle event as a map, but it is not working, at least for me.
Environment
- Elixir version (elixir -v): 1.9
- Phoenix version (mix deps): 1.4.10
- NodeJS version (node -v): v8.10.0
- NPM version (npm -v): 3.5.2
- Operating system: Ubuntu 18.04.1 LTS
Actual behavior
(FunctionClauseError) no function clause matching in handle_event/3
handle_event(“inc”, “”, %{struct: Phoenix.LiveView.Socket, assigns: ..
Expected behavior
As documentation on phx-value- should send the values myvar and mvar2(typo in documentation) to the handle event inc
def handle_event(“inc”, %{“myvar1” => “val1”, “myvar2” => “val2”}, socket) do
Most Liked
ahv.javier
Well… this is embarrassing, so if anyone else happens to encounter this error remember to npm install to update your live view js lib…
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









