Created
September 18, 2013 19:02
-
-
Save validkeys/6613930 to your computer and use it in GitHub Desktop.
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
| # backbone/entities/user.js.coffe | |
| @Aplat.module "Entities", (Entities, App, Backbone, Marionette, $, _) -> | |
| class Entities.User extends Entities.Model | |
| class Entities.Users.Collection extends Entities.Collection | |
| model: Entities.User | |
| API = | |
| setCurrentUser: (currentUser) -> | |
| new Entities.User currentUser | |
| App.reqres.setHandler "set:current:user", (currentUser) -> | |
| API.setCurrentUser currentUser | |
| # backbone/app.js.coffee | |
| @Aplat = do (Backbone, Marionette) -> | |
| App = new Marionette.Application | |
| App.on "initialize:before", (options) -> | |
| @currentUser = App.request "set:current:user", options.currentUser | |
| App.addRegions | |
| globalNavRegion: "#global-nav-region" | |
| commandCenterRegion: "#command-center-region" | |
| mainRegion: "#main-region" | |
| parentRegion: "#parent-region" | |
| firstChildRegion: "#first-child-region" | |
| secondChildRegion: "second-child-region" | |
| App.addInitializer -> | |
| App.module("CommandCenterApp").start() | |
| App.module("GlobalNavApp").start() | |
| App.on "initialize:after", -> | |
| if Backbone.history | |
| Backbone.history.start() | |
| App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment