Couch Potato: Conceptual Overview

In a traditional AngularJS application, you define and configure all components before the application runs. The seperation between "configuration time" and "run time", along with the dependency injection system, enables the programmer to define all components in any order and to know that they will all be configured prior to any of them being run. This might sound like a truism!

There may be application where defining and configuring every component that the application will use is not optimal. A few reasons to delay are:

In these cases, one may want to delay loading components. Couch Potato is intended to make the above cases possible.

Additionally, you may have an application that, while developing it, you do not know which components will ultimately be used. For example, in a CMS (Content Management System), it is conceivable that components that did not even exist when the application was built are intended to be used within the application.

In such a case, you most certainly need to delay loading the component!

Couch Potato is intended to be part of a solution for this type of loose binding.

How It Works provides a relatively high-level explanation of the methods that Couch Potato employs to allow for lazy loading and registration of components.