0

How to update the URL in the address bar but without reload to that URL?

I found 2 solutions :

Solution 1:
Read here https://stackoverflow.com/a/4059844/2642351
Using window.history.replaceState. However, when I implement it in my angularjs project it reverts back the URL immediately ot the previous one.

Solution 2:
Read here https://stackoverflow.com/a/24102139/2642351
This works for ngRoute however, Im using uiRouter. Is there a similar solution in uiRouter?

Community
  • 1
  • 1
Temp O'rary
  • 5,366
  • 13
  • 49
  • 109
  • 1
    Possible duplicate of [AngularJS UI Router - change url without reloading state](http://stackoverflow.com/questions/23585065/angularjs-ui-router-change-url-without-reloading-state) – Abdul Rehman Sayed Jul 16 '16 at 12:49

1 Answers1

0

You can use $location.path() to change the url without reloading it.You can read about it from the link given below.

Information on $location

Neel
  • 428
  • 1
  • 4
  • 12