Home Manual Reference Source Repository
public class | source

AppRouter

Extends:

EventsRouter → AppRouter

Provides a basic Backbone.Router to route between app states: all, active & completed. When a user navigates between these different filter type states Backbone.history.navigate is invoked in App->selectFilter to update the navigation history allowing the user to use the back and forward browser controls to navigate the app. When a filter type is selected it is referenced in the current URL for the web app.

Please note that in App.js->s_INITIALIZE_ROUTES a default catch all no route callback is specified which handles unmatched routes.

Constructor Summary

Public Constructor
public

Creates the routes delegated to the given methods specified.

Inherited Summary

From class Events
public

bind(): *

Delegates to on.

public

listenTo(obj: object, name: string, callback: function): Events

Tell an object to listen to a particular event on an other object.

public

listenToOnce(obj: object, name: string, callback: function): Events

Just like listenTo, but causes the bound callback to fire only once before being removed.

public

off(name: string, callback: function, context: object): Events

Remove a previously-bound callback function from an object.

public

on(name: string, callback: function, context: object): *

Bind a callback function to an object.

public

once(name: string, callback: function, context: object): *

Just like on, but causes the bound callback to fire only once before being removed.

public

stopListening(obj: object, name: string, callback: function): Events

Tell an object to stop listening to events.

public

Trigger callbacks for the given event, or space-delimited list of events.

public

unbind(): *

Delegates to off.

From class Router
public

Stores the routes hash.

public

execute(callback: function, args: *[], name: string)

Execute a route handler with the provided parameters.

public abstract

Initialize is an empty function by default.

public

navigate(fragment: string, options: object): Router

Simple proxy to Backbone.history to save a fragment into the history.

public

route(route: string | RegExp, name: string, callback: function): Router

Manually bind a single named route to a callback.

Public Constructors

public constructor source

Creates the routes delegated to the given methods specified.

Override:

Router#constructor