I have various inputs that call this function when they are changed:
$scope.updateOutputData = function(){
// gathering data and making data object
$scope.selectionObject = {
"departure_city" : departureCityDigest,
"departure_country" : departureCountryDigest,
"budget_min" : $scope.budget.min,
"budget_max" : $scope.budget.max,
"person_count" : $scope.selectedPersonCount,
"currency" : $scope.selectedCurrency,
"month" : $scope.selectedMonth,
"year" : $scope.selectedYear,
"flight_duration_min" : $scope.flightDuration.min,
"flight_duration_max" : $scope.flightDuration.max
};
// implement functionality to send this object to be read by backend
}
Basically this function gathers all input data and afterward it should send that object to backend, so in backend I can process this data and then depending on it, return back JSON API with data from database.
I do not know how to code this. I added comment in the bottom of my method. There should be code that sends data to backend and expects some JSON API to be returned. How would that code look like?