Created
April 7, 2012 20:32
-
-
Save todoubled/2331958 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
# index.html | |
<script src="/javascripts/lib/require.js" data-main="/javascripts/app/config.js"> | |
# public/coffeescripts/app/config.coffee | |
require.config | |
deps: ["initialize"] | |
paths: | |
"jquery":"lib/jquery" | |
"initialize": "app/initialize" | |
"App": "app/application" | |
"View": "app/views/view" | |
# public/coffeescripts/app/initialize.coffee | |
require ["App", "jquery"], (App, $) -> | |
$(document).ready -> | |
new App() | |
# app/application.coffee | |
define (require) -> | |
View = require 'View' | |
class App | |
constructor: -> | |
new View() | |
# app/views/view.coffee | |
define (require) -> | |
$ = require 'jquery' | |
class View | |
constructor: -> | |
$('body').html '<div id="app"></div>' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment