Skip to content

Instantly share code, notes, and snippets.

@joshuaballoch
Created January 9, 2013 14:45
Show Gist options
  • Save joshuaballoch/4493648 to your computer and use it in GitHub Desktop.
Save joshuaballoch/4493648 to your computer and use it in GitHub Desktop.
ideas on how to attach page-specific javascript
javascript:
window.app = window.app || {};
app.view = new Ledapei.SomeNameOfAView();
class Ledapei.SomeNameOfAView extends Backbone.View
el: "body"
events:
#declare events as you usually would:
"click .something": "method_to_fire"
initialize: (opts)->
that = this
#do other things in here on initialize
method_to_fire: (event)->
$target = $(event.currentTarget);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment