location.reload(true) is deprecated

Dilshan Liyanage picture Dilshan Liyanage · Mar 12, 2019 · Viewed 29.5k times · Source

I know that it is not ideal to reload an Angular Single Page Application. However there is a place that I need to reload the full application.

TSLint says that reload is deprecated.

Is there any alternative for this?

Answer

Zachary Schroeder picture Zachary Schroeder · Mar 12, 2019

You can use location.reload() without the forceReload flag. This is just deprecated because it is not in the spec: https://www.w3.org/TR/html50/browsers.html#dom-location-reload