Skip to content

Instantly share code, notes, and snippets.

@techwraith
Last active December 18, 2015 22:29
Show Gist options
  • Save techwraith/5854963 to your computer and use it in GitHub Desktop.
Save techwraith/5854963 to your computer and use it in GitHub Desktop.
var Backbone = require('backbone')
, example = require('./routes/example.js')
, _ = require('lodash');
var App = Backbone.router.extend({
initialize: function () {
this.route('example', _.bind(example, this))
}
});
module.exports = App;
var App = require('./app.js')
, Backbone = require('backbone');
window.app = new App();
Backbone.history.start();
var example = function () {
// your route
/*
* also, `this` will be your `app`
*/
}
module.exports = example;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment