Router

Router for handling routing events (ie. changes of the URL) and resolving and triggering corresponding states.

Constructor

new Router(appInstance)

Constructor

Parameters:
NameTypeDescription
appInstanceApp

Instance of app

Methods

addRoute(route, stateClass)

Adds route and action

Parameters:
NameTypeDescription
routestring

Route pattern

stateClassState

State class which belongs to route pattern

disable()

Disables router logic

enable()

Enables router logic

setUrl(url)

Update browser URL without triggering the processing

Parameters:
NameTypeDescription
urlString

Sets the url part