Skip to content

Instantly share code, notes, and snippets.

@chalettu
Created June 10, 2015 20:53
Show Gist options
  • Save chalettu/2198bb6f37fa8e69c99f to your computer and use it in GitHub Desktop.
Save chalettu/2198bb6f37fa8e69c99f to your computer and use it in GitHub Desktop.
sample code for angular route resolution
$urlRouterProvider.otherwise(function ($injector, $location) {
// console.log("loading main");
if ($location.$$url === '/') {
// $urlRouterProvider.otherwise('/');
// window.location = '/';
}
else {
console.log("passing to webserver to handle it");
// pass through to let the web server handle this request
window.location = $location.$$absUrl;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment