/** * * User: Martin Donnelly * Date: 2016-09-09 * Time: 15:11 * */ (function($) { var TodayDataModel = Backbone.Model.extend({ initialize: function() { this.set('url', '/today/data'); console.log(this.get('url')); //this.update(); } }); var webSocketModel = new SOCKETMANAGER(); webSocketModel.turnOn(); var clock = new Clock({model: new ClockModel()}); var weatherModel = new WeatherModel({lat: 55.95, long: -4.5666667}); var weather = new Weather({model: weatherModel}); var trainModel = new TrainModel(); var train = new Train({model: trainModel}); webSocketModel.setWeather(weatherModel); webSocketModel.setTrain(trainModel); setTimeout(function(){ console.log('request update'); webSocketModel.getUpdate(); }, 500); })(jQuery);