I have the following class that extends Backbone.View, I want all my backbone views to inherit from this class:
class BaseView
constructor: (options) ->
@bindings = []
Backbone.View.apply(@, [options])
_.extend(BaseView.prototype, Backbone.View.prototype, {
#etc. tec.
BaseView.extend = Backbone.View.extend
I can then extend my own view like this:
class BusinessUnitsView extends BaseView
initialize: (options) ->
This all works fine if they are in the same file but if I separate BaseView into a different file, I get an error message:
BaseView is undefined
How can I keep the BaseView in a different file and use it to extend my custom views?