What are the possible data update scenarios for change detection?

The change detection works in the following scenarios where the data changes needs to update the application HTML.

  1. Component initialization: While bootstrapping the Angular application, Angular triggers the ApplicationRef.tick() to call change detection and View Rendering.
  2. Event listener: The DOM event listener can update the data in an Angular component and trigger the change detection too.
  3. HTTP Data Request: You can get data from a server through an HTTP request
  4. Macro tasks setTimeout() or setInterval(): You can update the data in the callback function of setTimeout or setInterval
  5. Micro tasks Promises: You can update the data in the callback function of promise
  6. Async operations like Web sockets and Canvas: The data can be updated asynchronously using WebSocket.onmessage() and Canvas.toBlob().