I'm having real problems writing a simple Backbone.js application using CoffeeScript and Zepto.js
This is the simplest kind of Backbone, but events do not fire. Am I also not mistaken in the console? Where am I mistaken?
class AppView extends Backbone.View
constructor: ->
@el = $("#books")
@template = _.template("<div>New Item <a href='' id='addNew'> add new item</a></div>")
events: {
"click" : "createNew"
}
render: =>
@el.html(@template())
createNew : ->
console.log "new"
$(document).ready ->
view = new AppView
view.render()
I followed the only example that I can find in CoffeeScript and Backbone together https://github.com/bnolan/Backbone-Mobile/blob/master/application.coffee
However, if I add super to my view code above, I get an undefined error, its code does not work.
source
share