Created
December 19, 2012 06:55
-
-
Save alexgby/4334936 to your computer and use it in GitHub Desktop.
Example Backbone Boilerplate module in Coffeescript
This file contains hidden or 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
| # Example module | |
| define [ | |
| # Application. | |
| "app" | |
| ], | |
| # Map dependencies from above array. | |
| (app) -> | |
| # Create a new module. | |
| Example = app.module() | |
| # Default Model. | |
| class Example.Model extends Backbone.Model | |
| # Default Collection. | |
| class Example.Collection extends Backbone.Collection | |
| model: Example.Model | |
| # Default View. | |
| class Example.Views.Layout extends Backbone.Layout | |
| template: "example" | |
| # Return the module for AMD compliance. | |
| return Example |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment