Reputation: 119
For some reason I amfiltering and my data is returning multiply times. for example if I have and ID return of 456, the data will return to row 4,5 and 6. Its driving me crazy. why is it looking at
var question = $filter('filter')($scope.existingList, {
QuestionID: item.QuestionID
});
console.log(question);
if(!item.answer && question.length>0 || !item.answer === item.answer){
//console.log(question);
item.answer = question[0].Response;
}
Upvotes: 0
Views: 43
Reputation: 69905
Change the if
condition to this if(!item.answer && question.length>0){
http://plnkr.co/edit/GEHRP4g1RyvwOPq9ntZq?p=preview
Upvotes: 1