Skip to content

Instantly share code, notes, and snippets.

@ianjosephwilson
Created September 9, 2013 22:08
Show Gist options
  • Save ianjosephwilson/6502189 to your computer and use it in GitHub Desktop.
Save ianjosephwilson/6502189 to your computer and use it in GitHub Desktop.
do not route a url with angular while using html5mode, ie. this route should leave angularjs and do a full page load
// ...
// ...
app.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
// ...
$routeProvider.otherwise({
redirectTo: function (params, path, search) {
search = jquery.param(search);
if (search) {
window.location = path + '?' + search;
} else {
window.location = path;
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment