0

How to force to refresh the page after redirecting one page to another page. When I try to use location.reload inside ngOnInit(). Page keeps refreshing.

the issue was created item is not updating in the DOM/Model until I refresh the page.

Any expert advice please.

Sample code link

Angular 5 page reload data refresh not working

klmuralimohan
  • 861
  • 4
  • 23
  • 44

1 Answers1

2

When you reload the page Angular application is reloaded as well, your component is initialized, ngOnInit() method runs, you refresh the page and this process starts again. It's not Angular-way to reload the page, you should perform all stuff without reloading.

Orphy
  • 244
  • 2
  • 7