elm-package install --yes evancz/elm-html
elm-make First.elm Second.elm --output bundle.js --yes
-
-
Save aotarola/86bf55a6aa6713869e80 to your computer and use it in GitHub Desktop.
Multiple Elm main modules
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
module First where | |
import Html exposing (span, text) | |
main = span [ ] [text "Hello First!"] |
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
<html> | |
<body> | |
<div id="first"></div> | |
<div id="second"></div> | |
<script src="bundle.js"></script> | |
<script> | |
var first = document.getElementById('first'); | |
Elm.embed(Elm.First, first); | |
var second = document.getElementById('second'); | |
Elm.embed(Elm.Second, second); | |
</script> | |
</body> | |
</html> |
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
module Second where | |
import Html exposing (span, text) | |
main = span [ ] [text "Hello Second!"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment