Skip to content

federicospini/backbone-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

backbone-router

Backbone.Router component

Installation

$ component install spini/backbone-router

History stuff

It provides Router.history instead of Backbone.history

Example

var Router = require('spini-backbone-router');

var Workspace = Router.extend({

  routes: {
    "help":                 "help",    // #help
    "search/:query":        "search",  // #search/kiwis
    "search/:query/p:page": "search"   // #search/kiwis/p7
  },

  help: function() {
    ...
  },

  search: function(query, page) {
    ...
  }

});

instantiate your Router


var myrouter = new Router(options);

and then start history


Router.history.start({pushState: true});

// or

Router.history.start();

API

See documentation for Backbone.Router

License

MIT

About

Backbone.Router component

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published