3

Does anyone knows a way to stop ui-sref from reloading a state?

I cant do it from '$stateChangeStart' event because the ui-sref is only changing the params and not the state name.

I have a book list on the left and book details on the left. I am navigating between books details. So the state name doesn't change only the params that is the book ID.

User can change books details but when the form is dirty and the user presses a link to another book I need to notify the user and stop from ui-sref to reload the state.

When the user clicks on a link I through an event and the book details controller catch the event and checks if the form is dirty. If so I need to stop ui-sref.

Thanks!

einav
  • 599
  • 3
  • 8
  • 15

1 Answers1

0

try find it there,

http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state

please write your code example..

hod caspi
  • 826
  • 2
  • 10
  • 17