Created
September 9, 2013 22:08
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
// ... | |
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