AbstractRoutes
On this page
AbstractRoutes ⇐ Trait
Kind: global abstract class
Extends: Trait
Properties
Name | Type | Description |
---|---|---|
isRoutes | boolean | flag Feature flag (always true) |
type | String | A type value which is an internal String field to identify this class |
moduleManager | AbstractModuleManager | A reference on the Module manager |
routerManager | AbstractRouterManager | A reference on the Router manager |
moduleId | String | The identifier of the module where those routes belongs to |
lastVisitedScreenBeforeExit | Screen | 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);
}
}
}
}
});