Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angularjs UI-Router Change URL without rendering

Does anyone know how to change the url in Angular UI-Router without rendering or changing the state?

like image 973
musdy Avatar asked May 30 '14 15:05

musdy


1 Answers

You can change the URL without changing the state by using:

$location.path("your/path/123").replace()

Or:

$state.go("my.state", {location: true, notify: false, reload: false})

Source: https://github.com/angular-ui/ui-router/issues/64 (last few answers)

General: After creating the model and receiving the id, store it in local storage. Then if user visits later or reloads, just check which id he edited last and change the state. You can offer the user to start from scratch by just deleting the local Storage key and reload.

like image 177
Pascal Raszyk Avatar answered Oct 13 '22 20:10

Pascal Raszyk