Skip to content

Instantly share code, notes, and snippets.

@zkessin
Created October 21, 2015 12:36
Show Gist options
  • Save zkessin/c44ec69469725a91ea63 to your computer and use it in GitHub Desktop.
Save zkessin/c44ec69469725a91ea63 to your computer and use it in GitHub Desktop.
DestinationNameBox.elm
module DestinationNameBox where
import Debug
import Html exposing (..)
import Html.Events exposing (onBlur, targetValue)
import StartApp.Simple exposing (start)
-- model
type alias Model = String
-- UPDATE
type Action = Update Model
update : Action -> Model -> Model
update action model =
case Debug.log "Action " action of
Update new -> new
-- View
--view : Signal.Address -> Model -> Html
view address model =
div []
[label [] [text "Destination Name"
, input [
onBlur address (Update targetValue (Signal.message address))
]
[ text model]]]
main =
start { model = "", update = update, view = view }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment