0

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

Plnkr here

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;
}

1 Answer 1

1

Change the if condition to this if(!item.answer && question.length>0){

http://plnkr.co/edit/GEHRP4g1RyvwOPq9ntZq?p=preview

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.