title: Angular window.onbeforeunload
body: <p>I'm working on a system that have some forms, each one on a state route of angularjs ui-router.</p>
  
  <p>My need is, if have some change on the current form, and the user try to change to another state without save, the system will show a confirmation message like <code>confirm</code> of javascript. The result is something like <code>window.onbeforeunload</code> on a multi-page app.</p>
  
  <p>Anyone have some way to do that?</p>
  
  <p>PS: I think to show code will not help, but if you need, add some comment..</p>