Wikipedia:Reference desk/Archives/Computing/2020 March 30

= March 30 =

Angular component not updating
I have run into a strange problem with Angular at work.

I have this kind of HTML table on an Angular component:

and then in the Angular component there is this kind of code: getData { this.service.getData.subscribe(   data => {      this.form = data.form;    }); }

Everything works all OK the first time  is called. But on subsequent calls, even if the  object returned by the service changes, the HTML page stays as it is.

I found this StackOverflow post and added a call to  in the   function, which solved the problem.

But my question is, why is Angular not updating the HTML page automatically when the data in the code changes? J I P &#124; Talk 21:20, 30 March 2020 (UTC)