I am quite new to backbone.js i am trying to access a var from file B to file A. currently i have declared file A as below
window.dog = Backbone.Collection.extend({
model : animal,
initialize : function(){
_.bindAll(this);
},
// this is where i am getting an error saying i have not defined dog
var dog= new dog();
})
File B :
var dog = function () {
this.eats = {};
this.dance.REQUEST = {};
this.walk.REQUEST.LIST = [];
};
Now I want the method eat to be called from script A how can I do this?