title: Conditional "otherwise" routing in Angular
body: <p>I'm familiar with the <code>"$urlRouterProvider.otherwise('{route here}')"</code> syntax in angular to use as catch all in Angular UI-Router.</p>
  
  <p>What I'm wondering is - is there a way to do conditional "otherwise" routing based on the parent state of when the route is entered incorrectly?</p>
  
  <p>For instance, suppose that I have the following configuration:</p>
  
  <pre><code>$stateProvider
  .state('core', {configuration here})
  .state('core.page1', {configuration here...})
  .state('dashboard', {configuration here})
  .state('dashboard.page1', {configuration here})
  
  $urlRouterProvider.otherwise('/core/page1');
  </code></pre>
  
  <p>What I'd like to have happen is that anytime a route is entered in that has <strong><code>"/core/{route here}"</code></strong>,<br>
  if it doesn't match any of the current states, to route back to <strong>'/core/page1'</strong>,<br>
  and anytime a route is entered that has <strong><code>"/dashboard/{route here}"</code></strong> that doesn't match any of the current states, to route back to <strong><code>"/dashboard/page1"</code></strong>.</p>
  
  <p>Anyone have experience doing this, or an idea of how I could accomplish it? Is there anything built in to Angular that allows for this type of behavior?</p>
  
  <p>Thanks in advance! </p>