Skip to content

Instantly share code, notes, and snippets.

@dupuchba
Created May 18, 2012 17:33
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 dupuchba/2726604 to your computer and use it in GitHub Desktop.
Save dupuchba/2726604 to your computer and use it in GitHub Desktop.
Backbone.js : AppRouter initializiation
// AppRouter initializiation
var AppRouter = Backbone.Router.extend({
routes:{
"":"list"
},
list:function () {
this.customerCollection = new CustomerCollection();
this.CustomerListView = new CustomerListView({model:this.customerCollection});
this.customerCollection.fetch();
$('.span10 offset1').html(this.CustomerListView.render().el);
}
});
var app = new AppRouter();
Backbone.history.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment