Skip to content

Files

Latest commit

95d3b64 · Apr 30, 2018

History

History

spa-routing

SPA Routing

This is an example which shows how you'd add SPA-style routing to an Elm application.

This example shows a list of albums, whose detailed information is revealed when an individual album is clicked. The hash changes to reflect the current album and allows for users to share links to individual albums.

This example uses hash-routing, but you could also use pushState - assuming your host/back-end recognizes the nested URLs.

Kudos to @simon-larson, whose Elm SPA Template was the basis for this example.

Demo

Running the example:

  • npm install --global elm elm-live (if you haven't already)
  • elm-live Main.elm --output=elm.js --open