2

I have a get request in angular that returns a streaming response. The request is made through the oboe library. The streaming response basically returns json values and my angular front end adds each of these streams to the scope on receiving each json object. Since oboe is not a part of angular itself, I am using $scope.$digest to update my scope. This is cause a huge memory leak for larger requests. I have figured that I have to use $destroy at some point. Can someone please tell me on which event I should use the $destroy for optimal performance?

Adnan
  • 584
  • 1
  • 15
  • 27

1 Answers1

0

I would have to think a little more about the angular internals to give a good answer. However, have you considered using https://github.com/RonB/angular-oboe, or talking a look at how that project deals with updates? They don't seem to use either $digest or $destoy

JuanCaicedo
  • 3,132
  • 2
  • 14
  • 36