Book Image

Knockout.JS Essentials

Book Image

Knockout.JS Essentials

Overview of this book

Table of Contents (16 chapters)
KnockoutJS Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Durandal life cycle


It is important we understand clearly how a Durandal application works. This is a schema of how your application starts:

  1. The index.html page uses RequireJS to request the main.js file.

  2. The main.js file configures require and defines the main module, which is responsible for the application configuration, and launches the shell module.

  3. The shell module handles the global context of the application. It manages components that will be persistent along the different life cycles. In the starter kit application, it manages the search bar. But it can also manage the log in and log out functionality, for example. The shell module is what configures all routes.

  4. Finally, the router configures the navigation along all the pages the application has.

    Durandal initialization life cycle

The activation life cycle

The activation life cycle controls the activation and the deactivation of the page. Durandal allows us to use predefined methods to access different parts of the cycle. Let's take...