title: Use Angular routing alongside roundtrip routing
body: <p>I'm working on a Django app which makes heavy use of Angular in some pages, e.g. at domain.com/myAngularApp</p>
  
  <p>Within the angular page I'm using Angular routing for navigating between different views/states within that page. However across the whole website there are navigation links which need to result in round trip requests to Django. However all the pages include the same compiled javascript file which includes the Angular route declarations.</p>
  
  <p>So my question is: how to I get Angular to mange its own routes and get out of the way when the location is changed (primarily by clicking a link on the page) to a path that it hasn't explicitly been told to own, i.e. to different subdirectories off the domain.</p>
  
  <p>My routing declaration looks something like:</p>
  
  <pre><code>myApp.config( function($locationProvider, $routeProvider) {
    $locationProvider.html5Mode(true);
    $routeProvider.when('/myAngularApp/', {
      templateURL: 'template1.html'
    });
    $routeProvider.when('/myAngularApp/stuff', {
      templateURL: 'template12.html'
    });
    $routeProvider.otherwise({redirectTo:  &lt;not sure what to do here...&gt;  });
  })
  </code></pre>
  
  <p>I've tried something like:</p>
  
  <pre><code>$routeProvider.otherwise({redirectTo: function(a1,r,a3){ window.location.href = r }})
  </code></pre>
  
  <p>But this makes the page refresh endlessly on any non-matched route.</p>
  
  <p>Leaving out the otherwise statement seems to make it impossible to leave a page with a non-matched route when accessed directly... don't really understand why?</p>
  
  <p>It must be possible to do what I want no?</p>