fixes + lightbulb
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
defmodule PokemonCoutureWeb.ClothesTrackerLive do
|
||||
use PokemonCoutureWeb, :live_view
|
||||
|
||||
def mount(_params, _session, socket) do
|
||||
socket = assign(socket, :light_bulb_status, "off")
|
||||
{:ok, socket}
|
||||
end
|
||||
|
||||
def handle_event("on", _value, socket) do
|
||||
socket =
|
||||
socket
|
||||
|> assign(:light_bulb_status, "on")
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
<h1>The light is <%= @light_bulb_status %>.</h1>
|
||||
<button phx-click="on">On</button>
|
||||
Reference in New Issue
Block a user