I'd like to propose a new Ractive feature. The goal is to use a JavaScript router to load a view without an intermediate step to render the layout (header, footer, etc.). In most frameworks you have to start the "App" then start the router. The "App" is the layout and the router loads and populates the main content. I prefer to have the router run the app without an intermediate step to render the layout. The router should load a view, let's start with the HomeView
, and the HomeView
should specify a LayoutView
. Creating the home view should also create and render the layout. When you attach the home view to the document you're also attaching it's layout.
Here's an example:
// layout/layoutView.js
define([
'ractive',