I deal with nodejs and i cannot figure out, why i cannot call class instance from another class function. Here is my code. Please help.
var StationDAO = require('./StationDAO.js');
var StationSearchCriteria = require('./StationSearchCriteria.js');
function GasStationService(lat, long, zoom) {
this.latitude = lat;
this.longitude = long;
this.zoom = zoom;
this.zoomToKilometers = 0.009;
/* ......... */
this.minLat = function () {
return this.latitude - this.zoomToKilometers;
};
this.minLong = function() {
return this.longitude - this.zoomToKilometers;
};
this.maxLat = function() {
return this.latitude + this.zoomToKilometers;
};
this.maxLong = function() {
return this.longitude + this.zoomToKilometers;
};
this.criteria = new StationSearchCriteria(this.minLat(), this.minLong(), this.maxLat(), this.maxLong());
this.conn = new StationDAO(criteria); // why this doesnt work