/**
 * Created by DennysO on 6/27/2015.
 */
var Locations = {};

var notifyLocationsComponents = function(id) {
    ////console.log(id);
    $(LocationsEntity).trigger(id);
};

var LocationsEntity = {
    doneLoading: false,
    get: function() {
        return Locations;
    },
    all: function() {
        var loadRequest = $.ajax({
            type: 'GET',
            url: "/api/getAll/locations",
            dataType: "json"
        });
        loadRequest.done(function(dataFromServer) {
            Locations = dataFromServer;
            notifyLocationsComponents('GetAllLocations');
        });
    },
};