Created
May 15, 2019 15:29
-
-
Save 50kudos/d855575c93d241c5c8c09f061ae4ed42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule FoldlaWeb.DataLive do | |
use Phoenix.LiveView | |
def render(assigns) do | |
FoldlaWeb.DataView.render("edit.html", assigns) | |
end | |
def mount(_params, socket) do | |
{:ok, assign(socket, :thing, 0)} | |
end | |
def handle_event("inc", _value, socket) do | |
{:noreply, assign(socket, :thing, socket.assigns.thing + 1)} | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span phx-ignore>Here is the thing: <%= @thing %></span> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
phoenix: "~> 1.4"
phoenix_live_view: github: "phoenixframework/phoenix_live_view"
View layout: default