in my app using http.post to get a json array that has been formed, on the server, from multiple arrays. Now my problem is that i should split this array into four separate arrays, I'll explain: JSON array example:
[{"Day", "11/17/2016", "time": "09:45"},
{ "Day", "17/11/2016", "time": "16:50"}, (.....)
{ "Day", "18/11/2016", "time": "11:25"},
{ "Day", "18/11/2016", "time": "12:30"}, (.....)
{ "Day", "11/21/2016", "time": "16:10"},
{ "Day", "11/21/2016", "time": "17:25"}]
Now from this array I should create 4 array, the first in which will be stored for several days, for example (17.11.2016, 11.18.2016, 21.11.2016), the second in which all times will be stored " belonging "to the first day for example (09:45, 16:50), the third in which will be stored all" belonging "times to the second day, for example, (11:25, 12:30) and the fourth in which will be stored all times "belonging" to the third day, for example (16:10, 17:25).
So the result will be something like this:
RESULT:
First array: (17.11.2016, 11.18.2016, 21.11.2016)
Second array: (09:45, 16:50)
Third array: (11:25, 12:30)
Fourth array: (16:10, 17:25)
Who can give me a hand or some advice?
Thank you
UPDATE: this is my controller where i retreive the JSON array:
.controller('AppCtrl', function($scope, $http) {
$scope.data = {};
$scope.submit = function(){
var link = 'http://localhost/ShuttleFIX/api.php';
$scope.var = "prova";
$http.post(link, {username : $scope.data.username}).then(function (res){
$scope.response = res.data;
});
};
});
And i should have a select with these options: 17.11.2016, 11.18.2016, 21.11.2016
And a select where i should have these options: 09:45, 16:50 if i choice the first day