Managing layouts

As mentioned in Chapter 2 , Model-View-Whatever, a layout in relation to an SPA is the server-side HTML page that is used to house, initialize, and display your app. The layout will contain similar HTML markup to the examples in the previous section regarding how to load your SPA container.

The layout is generally the only native server-side component necessary to create an SPA, the other components being the native frontend code and the external API for providing endpoints for data consumption and manipulation.

Static layouts

A layout can be something as simple as a static HTML page that is loaded onto a web server and calls the resources necessary for loading your app within a defined container element on that page. Ideally, once ...

Get Mastering JavaScript Single Page Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.