Created
July 10, 2016 23:29
-
-
Save nZac/14b8e07ed5a019d5e582c21c517bab24 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
-- Compile to app.js | |
import Html exposing (Html, button, div, text) | |
import Html.App as App | |
import Html.Events exposing (onClick) | |
main = | |
App.beginnerProgram { model = 0, view = view, update = update } | |
type Msg = Increment | Decrement | |
update msg model = | |
case msg of | |
Increment -> | |
model + 1 | |
Decrement -> | |
model - 1 | |
view model = | |
div [] | |
[ button [ onClick Decrement ] [ text "-" ] | |
, div [] [ text (toString model) ] | |
, button [ onClick Increment ] [ text "+" ] | |
] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title></title> | |
<script type="text/javascript" charset="utf-8" src="{{ url_for('static', filename='js/app.js') }} "> | |
</script> | |
</head> | |
<body> | |
<!-- Put elm app here --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment