Automatic refresh of angular data update template

I have an array passed from the background

the data in the array is constantly changing

I want to refresh automatically when the contents of the array change without reorganizing the page template block

how can this be achieved?

Mar.25,2022
The

array is a reference variable, and if no impure pipe,angular is added to it, it will only detect whether the address of the variable has changed each time it is detected. That is to say, even if the content changes, but the memory address of the variable does not change, angular will not think that the variable has changed, so the page will not be refreshed. You can use async pipe. Or set the array variable to null, and then reassign it each time the array content is updated. But the second method is not very rigorous and should be used with caution.


Asynchronous operation may not trigger the check mechanism of angular. At this point, you can try to manually remind angular to re-render the view

  import { NgZone } from '@angular/core';
  constructor(public _ngZone:NgZone) {}

  public refresh() {
    this._ngZone.run(() => {});
  }

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32a0b-2b678.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32a0b-2b678.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?