Created
May 20, 2016 08:29
-
-
Save vschoettke/8f722779f1675f175fe399fc0ae384ec 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 Main exposing (..) | |
import Html exposing (Html, ul, li, div, text) | |
import Html.App as Html | |
import Html.Events exposing (onMouseEnter) | |
main = | |
Html.beginnerProgram { model = 0, view = view, update = update } | |
type Msg | |
= Select Int | |
update msg model = | |
case (Debug.log "Msg" msg) of | |
Select x -> | |
x | |
view model = | |
div [] | |
[ text | |
("Move mouse over \"Second\" (\"First\" will turn to upper case). " | |
++ "Now alterate between moving the mouse over this text and \"First\" " | |
++ "and you will get an Uncaught TypeError: Cannot read property 'decoder' of null" | |
) | |
, ul [] | |
[ if (model == 1) then | |
li [ onMouseEnter (Select 0) ] [ text "FIRST" ] | |
else | |
li [] [ text "First" ] | |
, li [ onMouseEnter (Select 1) ] [ text "Second" ] | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment