Skip to content

Instantly share code, notes, and snippets.

@codedmart
Created September 9, 2015 23:34
Show Gist options
  • Select an option

  • Save codedmart/f0fd51a7f67e53460779 to your computer and use it in GitHub Desktop.

Select an option

Save codedmart/f0fd51a7f67e53460779 to your computer and use it in GitHub Desktop.
module Test where
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import StartApp.Simple as StartApp
type Action = Update String
actions = Signal.map Update updateText
port updateText : Signal String
initialModel =
{ text = "Hello from Elm!"
}
update action model =
case action of
Update txt ->
{ model | text <- txt }
_ -> model
view address model =
h1 [id "id", class "class", onClick address (Update "Changed!")] [text model.text]
main =
StartApp.start
{ model = initialModel
, view = view
, update = update
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment