title: UI-Router doesn't get previous state on $stateChangeSuccess
body: <p>I need to prevent users from going to certain states (dashboard and account) on the app if they have not completed all required enrollment steps. If a user tries to access those states by direct URL input, I will redirect them back to where they are. I am doing this simple check on my <code>run</code> block to redirect the user conditionally:</p>
  
  <pre><code>$rootScope.$on("$stateChangeSuccess", (event, toState, toParams, fromState, fromParams) =&gt; { 
      let shouldPreventNavigationToAccountPages = fromState.name.includes('enroll') &amp;&amp; toState.parent === 'layout';
  
      if (shouldPreventNavigationToAccountPages) {
        redirectUser();
      }
  } 
  </code></pre>
  
  <p>So if a user comes from a "enroll" state (say "enroll.step-one") and tries to access a "layout" state they are not allowed to, they should be redirected. However, when I input the URL directly (no click on link), "fromState"returns the following object:</p>
  
  <pre><code>{name: "", url: "^", views: null, abstract: true}
  </code></pre>
  
  <p>I don't have access to the previous state and cannot perform the check on <code>fromState.name.includes('enroll')</code>. Is this a default behavior in UI-Router? Is there a way to get the previous state if user tries to access a page by inputing the URL directly on browser?</p>