Created
October 21, 2015 12:36
-
-
Save zkessin/c44ec69469725a91ea63 to your computer and use it in GitHub Desktop.
DestinationNameBox.elm
This file contains hidden or 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
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