Im trying to export my jQuery file as a module using module.exports so it can be called using:
var saveLocation = require('saveLocation');
Have tried: module.exports = jQuery(function saveLocation(){...
How can I go about exporting this code.
N.B. I have removed some of my function code for simplicity of the issue.
Here is my code:
'use strict';
jQuery(function saveLocation(){
var saveLocationContainer = jQuery('.save-container'),
favoriteIcon = saveLocationContainer.find('.glyphicon'),
favoriteLocationsListGroup = jQuery('.list-group');
var hasFavoriteLocations = false;
// The following function outputs the specific address info based on location
function showLocationByAddress(e) {
e.preventDefault();
}
};