Created
May 18, 2012 17:33
-
-
Save dupuchba/2726604 to your computer and use it in GitHub Desktop.
Backbone.js : AppRouter initializiation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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