Currently, I am populating a list of items by using the ng-repeat directive. Within one of the fields, I pass the ID obtained from the ng-repeat to a function that retrieves information from another database table. The issue I am encountering is that when I execute this and log the result in the console, it seems to be stuck in a loop.
<ion-slide-box ng-repeat="q in questions.list track by $index">
<ion-slide class="default box">
<div class="amount">{{ getAmountQuestion(q.guid) }}</div>
<div class="question"><h5>{{ q.fields.question }}</h5></div>
</ion-slide>
</ion-slide-box>
$scope.getQuestionAmount = function(id) {
QuestionsService.getAllVotesById(id).then(function (data) {
console.log(data.count);
});
};