In almost every view in my app user may edit some content and then click "save" to sync edited data to server. If user edits some data, does not save them and redirects to another page/view/controller via HTML link or Chaplin.utils.redirectTo method, then I would like to show a modal thats says something like "Hey you didn't save your data - are you sure you want to leave this page?".
Where and how I can catch "redirect" event and prevent it when neccessery?
In almost every view in my app user may edit some content and then click "save" to sync edited data to server. If user edits some data, does not save them and redirects to another page/view/controller via HTML link or
Chaplin.utils.redirectTo
method, then I would like to show a modal thats says something like "Hey you didn't save your data - are you sure you want to leave this page?".Where and how I can catch "redirect" event and prevent it when neccessery?