Classes / Ladybug.Router

EXTENDS

Ladybug.Class

OVERVIEW

Handles the hash-based routing.

BASIC USAGE

This class is used internally by the Ladybug.Application class. If you want to get a better understanding of how it works, please check the source at GitHub.

CLASS METHODS

function init(options)

Initization callback, this is run by the constructor

Available options

  • onRouteChange Route change callback

function start()

Starts the router, call this from your Application object onDomReady callback (or onFacebookReady if you're extending Ladybug.FacebookApplication)


function navigate(route)

Force a hash-change event and render a new module.

Available parameters

  • route String with the route to navigate to, not including the hash, for example /contact

See Ladybug.Class for inherited class methods.

CLASS MEMBERS

callback

Start-up callback


defaults

Hash with default options


See Ladybug.Class for inherited class members.

Go back to previous page