title: Prevent a stateChange with angular ui router without using $rootScope
body: <p>My user can leave a state but before I want to show a modal dialog "Do you want to save?" </p>
  
  <p>ONLY if the user data is dirty that means changed.</p>
  
  <p>What I do NOT want is to stick a  isDirty property in my EditController to the $rootScope go to the stateChangeStart event and check there for isDirty and then show/not the save dialog.</p>
  
  <p>Prevent global variables says every javascript beginner book...</p>
  
  <p>1.) What is then the pro way to prevent a state change without hacking the $rootscope?.</p>
  
  <p>2.) Are there any helper libraries for ui-router which enhance the ui-router offering function hooks inside the controller to encapsulate the ui logic?</p>