We are going to take a high-level look at what an Elm application looks like? We show how to structure apps, as well as, Elm’s elegant syntax by building a small app.
import StartApp.Simple as StartApp
import Html.Events exposing (onClick)
main =
StartApp.start
{
model = initialModel,
view = view,
update = update
}
initialModel = 0
type Action
= Increment
| Decrement
update action model =
case action of
Increment ->
model + 1
Decrement ->
model - 1
view address model =
div []
[
button [onClick address Increment] [text "+"],
div [] [text (toString model)],
button [onClick address Decrement] [text "-"]
]
$ elm-package install evancz/elm-html
$ elm-package install evancz/start-app
$ elm make Main.elm --output=index.html
Thinking would be helpful if a how to setup elm
is provided
I get UNFINISHED LIST error from «[ input [ type' "text"».