Skip to content

Instantly share code, notes, and snippets.

@julesbou
Created March 11, 2016 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julesbou/f32ab46ebf5f0039aa0e to your computer and use it in GitHub Desktop.
Save julesbou/f32ab46ebf5f0039aa0e to your computer and use it in GitHub Desktop.
var Router = Backbone.Router.extend({
before: function() {
console.log('before');
},
after: function() {
console.log('after');
},
routes: {
'': function() {
console.log(‘index’);
}
}
})
var router = new Router();
Backbone.history.start();
router.navigate(''); // 'before' 'index' 'after'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment