Home Reference Source
import {ArvaRouter} from 'arva-js/routers/ArvaRouter.js'
public class | source

ArvaRouter

Extends:

eventemitter3~EventEmitterRouter → ArvaRouter

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

decode: *

public
public
public

history: *

public

routes: *

public

specs: *

Method Summary

Public Methods
public

add(route: String, handlers: Object): void

Registers a single controller.

public

go(controller: Controller | Function | String, method: String, params: Object): void

Triggers navigation to one of the controllers

public
public
public

On a route change, calls the corresponding controller method with the given parameter values.

public

setBackButtonEnabled(enabled: *)

public

setControllerSpecs(specs: Object): void

Sets the animation specs object for use by the famous-flex AnimationController.

public

setDefault(controller: Controller | Function | String, method: String): void

Sets the initial controller and method to be activated whenever the controllers are activated.

public

setInitialSpec(spec: *)

Inherited Summary

From class Router
public
public
public
public

add(route: String, handler: Function): void

Registers a single controller.

public

go(controller: Controller | Function | String, method: String, params: Object): void

Triggers navigation to one of the controllers

public

On a route change, calls the corresponding controller method with the given parameter values.

public

setDefault(controller: Controller | Function | String, method: String): void

Sets the initial controller and method to be activated whenever the controllers are activated.

Public Constructors

public constructor source

Override:

Router#constructor

Public Members

public decode: * source

public defaultController: * source

Override:

Router#defaultController

public defaultMethod: * source

Override:

Router#defaultMethod

public history: * source

public routes: * source

public specs: * source

Public Methods

public add(route: String, handlers: Object): void source

Registers a single controller.

Override:

Router#add

Params:

NameTypeAttributeDescription
route String

Route to trigger handler on.

handlers Object
handler.enter Function

Method to call on entering a route.

handler.leave Function

Method to call on when leaving a route.

Return:

void

public go(controller: Controller | Function | String, method: String, params: Object): void source

Triggers navigation to one of the controllers

Override:

Router#go

Params:

NameTypeAttributeDescription
controller Controller | Function | String

The controller instance, controller constructor, or controller name to go to.

method String

The method to call in given controller.

params Object

Dictonary of key-value pairs containing named arguments (i.e. {id: 1, test: "yes"})

Return:

void

public goBackInHistory() source

public isBackButtonEnabled(): * source

Return:

*

public run(): Boolean source

On a route change, calls the corresponding controller method with the given parameter values.

Override:

Router#run

Return:

Boolean

Whether the current route was successfully ran.

public setBackButtonEnabled(enabled: *) source

Params:

NameTypeAttributeDescription
enabled *

public setControllerSpecs(specs: Object): void source

Sets the animation specs object for use by the famous-flex AnimationController.

Params:

NameTypeAttributeDescription
specs Object

Animation specs, keyed by target controller.

Return:

void

public setDefault(controller: Controller | Function | String, method: String): void source

Sets the initial controller and method to be activated whenever the controllers are activated.

Override:

Router#setDefault

Params:

NameTypeAttributeDescription
controller Controller | Function | String

Default controller instance, controller constructor, or controller name to go to.

method String

Default method to call in given controller.

Return:

void

public setInitialSpec(spec: *) source

Params:

NameTypeAttributeDescription
spec *