Skip to content
Bob Holt edited this page Jun 27, 2013 · 2 revisions

Previous: Models and Collections

Keel is built around the concept of "pages." Even in a single-page app, we find it useful to maintain this paradigm. Distinct sections of the application are separate "pages," and are triggered by Backbone routes. We have intended to leave the Router extensible, so sub-page routes can be implemented by the developer.

At the code level, pages are no different from widgets or any other view. However, they can be thought of as super-parent views, which do nothing more than spawn child views inside themselves.

When pages are instantiated, they are bound to a pageBeforeChange event that fires on every page route. This event causes the page to destroy itself and all of its children. Once the old page is destroyed, the new page is loaded via RequireJS, rendered, and placed in the DOM. The page is responsible for instantiating all of its children.

Next: Creating Child Views

Clone this wiki locally