title: How to run a function before page refresh in Angular if statement is true?
body: <p>I have an application with 8 different routes using <code>$rootProvider</code>.</p>
  
  <p>If I am on <code>/signUp</code> and a page reload is detected, I want to check if <code>$scope.createAccView = true</code>. If it is true then run a function.</p>
  
  <p>I tried doing this different ways, by using <code>$routeChangeStart</code> and <code>$routeChangeSuccess</code> but it did not work.</p>
  
  <p>Mainly the main problem is, if a route change is detected and if <code>$scope.createAccView = tru</code>e then I need to run a function before changing the route. </p>
  
  <p>Anybody know how could I accomplish this?</p>