Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
Angular 4: zones sockets and change detection

Our application uses sockets, we are using socket.io and its events are wrap with Observables.

In one area of our application we have a graph that updates every 10th of a second. The graph is drawn with D3 and draws directly without using angular.

We would like to disable change detection for the graph area completely and ensure that each socket response (Observable) does not trigger change detection anywhere in the application tree.

We tried using zone.runOutsideAngular, but we had to put it at the lower socket layer where we subscribe to the Observable that wraps socket.io...Although this worked, it runs ALL socket events outside angular. We need to run only the graphing events outside of angular's zone.

Ideally we need to use zones or something at the component level and only for the graphs, because other areas of the application do need change detection from socket events...

It is my understanding that any async operations such as socket events will trigger change detection.

Can we disable this at a higher level without having to touch lower level services?

What is the best approach for running specific socket.io events outside of angular's zone in order to avoid change detection in the whole application?

Any insight would be greatly appreciated.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!