Difference between $ window.location.reload () and $ route.reload () in angularjs

What is the difference between $ window.location.reload () and $ route.reload () in Angular.js?

I used these two things, but both work the same.

Can someone explain the differences?

+6
source share
1 answer

$window.location.reload() - Used to reload the page

$route.reload() - Forces $ route service to reload the current route, even if $location not changed.

As a result of this, ngView creates a new area and restores the controller.

+4
source

Source: https://habr.com/ru/post/984541/


All Articles