AbstractRoutes

AbstractRoutes ⇐ Trait

Kind: global abstract class
Extends: Trait
Properties

NameTypeDescription
isRoutesboolean

flag Feature flag (always true)

typeString

A type value which is an internal String field to identify this class

moduleManagerAbstractModuleManager

A reference on the Module manager

routerManagerAbstractRouterManager

A reference on the Router manager

moduleIdString

The identifier of the module where those routes belongs to

lastVisitedScreenBeforeExitScreen

The last screen used before we re-route to another module

AbstractRoutes()

Define the routes of a module.

A route is a function that returns a Promise and that is executed following the AbstractRouterManager#route call. All methods declared in this class are considered as route, excepted protected/private methods and executeRoute, enterModule and exitModule. The aim of a route is to display the right screen, depending on the context.

Example

$Routes.declare("WatchRoutes", {
   methods: {
      watch: function (data) {
          if (data && data.source) {
              if (data.source.instanceOf($AbstractMedia)) {
                  $MediaScreen.display(data);
              } else {
                  $LiveScreen.display(data);
              }
          }
      }
  }
});