I have $scope.participants = []
as a global variable. My problem is when I used this variable in another function after calling the function below. $scope.participants
is empty. However, it isn't when I checked the response.data
.
$scope.getParticipants = function(seminar_id,seminar_name,seminar_code) {
$http({
method: 'GET',
dataType: 'JSON',
params: { 'seminar_id' : seminar_id },
url: 'getParticipants'
}).then(function(response) {
$scope.participants=response.data;
});
}