Created
May 5, 2016 05:35
-
-
Save gdotdesign/4d4985415b1d4daca4fb48aee01bbd50 to your computer and use it in GitHub Desktop.
Uncaught TypeError: Cannot read property 'decoder' of null
This file contains 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
import Html.Attributes exposing (style) | |
import Html.Events exposing (onClick, onMouseDown) | |
import Html exposing (node, text) | |
import Html.App | |
type alias Model = | |
{ color : String | |
, clicks : Int | |
} | |
type Msg | |
= Click | |
init : Model | |
init = | |
{ clicks = 0 | |
, color = "black" | |
} | |
update : Msg -> Model -> ( Model, Cmd Msg ) | |
update msg model = | |
case msg of | |
Click -> | |
( { model | clicks = model.clicks + 1, color = "red" }, Cmd.none ) | |
view : Model -> Html.Html Msg | |
view model = | |
node | |
"div" | |
[ onClick Click | |
, onMouseDown Click | |
, style [("font-size", "30px")] | |
] | |
[ text (toString model.clicks) ] | |
main = | |
Html.App.program | |
{ init = ( init, Cmd.none ) | |
, view = view | |
, update = update | |
, subscriptions = \model -> Sub.none | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment