Reputation: 1319
Typically, when using Coffee Script I add methods to Backbone.Marionette.Application like so...
do (Backbone) ->
_.extend Backbone.Marionette.Application::,
testMethod: ->
console.log "I was here"
I was wondering if there is a more "Coffee Script'ish" way to do this. IE with the extends keyword and not using underscores extend.
Upvotes: 2
Views: 442
Reputation: 14671
as you have it written, there is no object to extend your app with, but if you want to create an object 'subclassed' you could do something like
class MyApp extends Backbone.Marionette.Application
testMethod: -> console.log "I was here"
which is basically what @mu is suggesting in his comment.
Upvotes: 2