Created
September 9, 2015 23:34
-
-
Save codedmart/f0fd51a7f67e53460779 to your computer and use it in GitHub Desktop.
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 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