0

I am using a 3rd party js library to make http requests to their api. I perform this operation on every keystroke in an input field using "ng-keyup". After the call to there api returns I set the $scope.results which populates the view. However the view always updates one iteration behind, debugging this looks to be with the async call.

Is there a way to refresh the view or make the async call differently rather than just a callback?

henry.oswald
  • 5,304
  • 13
  • 51
  • 73

1 Answers1

0

Looks like your callback might be executing outside of angular context. Try calling $scope.$apply() in async callback. If that's not the issue, post some code please :)

kamilkp
  • 9,690
  • 6
  • 37
  • 56