5

I have a setInterval() function in a component class that fires off every 1/10 of a second. All it does is update a d3 graph and does not touch any angular bindings.

By default setInterval() triggers the change detection in angular from the root node.

Is there a way to run the setInterval() function without triggering any change detection?

I don't need the rest of the app to update itself since I know this only affects the graph and d3 is the only one responsible for the updating the graph.

Nik
  • 7,086
  • 6
  • 36
  • 52

1 Answers1

3

You have to run it outside of angular. Take a look at this answer to a similar question.

https://stackoverflow.com/a/39626378/1710501

Community
  • 1
  • 1
camccar
  • 690
  • 12
  • 24