Class

Router

Router(app, routes)

Class representing a router to handle contexts.
Constructor

# new Router(app, routes)

Create a dot.
Parameters:
Name Type Description
app object The app object.
routes object The routes object.

View Source router.js, line 4

Classes

Router

Methods

# getRouteByName(routeName) → {object}

Get a route by its name.
Parameters:
Name Type Description
routeName string Name of route to find.

View Source router.js, line 44

The route or null.
object

# handlePopState()

Handle pop state events. Pop state events are fired from the browser, ie. when user goes back and forth in the browser hostory.

View Source router.js, line 34

# loadRoute(route, pushFlag)

Load a route.
Parameters:
Name Type Default Description
route object The route to load.
pushFlag boolean true If true, new state will be pushed to window.history

View Source router.js, line 64

# loadRouteByName(routeName, pushFlag)

Load a route by its name.
Parameters:
Name Type Default Description
routeName string Name of route to load.
pushFlag boolean true If true, new state will be pushed to window.history

View Source router.js, line 54

# start(routeName)

Start routing
Parameters:
Name Type Description
routeName string Name of route to start with.

View Source router.js, line 22