O'Reilly logo

Programming Elm by Jeremy Fairbank

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Route to a Component Page

So far, your single-page application only displays placeholder content. You need it to display a feed of photos and an account page. Inside your picshare-spa/src directory, you have an Account.elm application so you could port its code and Picshare’s code into Main.elm. But then that would create a large, unwieldy application.

Instead, you will build a modular application with components. In this section, you will learn what components are and how to wire up an Account component inside the Main module. You will store Account’s model inside Main’s model, route Account messages from Main to Account, and display Account’s content inside Main’s view function.

Build an Account Component

Before you begin, familiarize yourself ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required