I'm creating a search application in angularjs with these settings:
App Config:
app.config(
[
'$locationProvider',
function ($locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false,
rewriteLinks: false
});
}
]
);
The problem is not the app itself but when im trying to access the page with IE9 im not able to access it at all. After doing som reading i found out that IE9 ignores everyting that comes after the # in an url, and redirects the user back to the host url (everything before the # in the url) And the standard fallback for html5mode is hashbang-mode. Angular docs for $location
My question is if anyone knows if there is any way around the use of hashbangs in the url or if anyone else have this problem. If more documentation is needed, please let me know and i will provide!
EDIT: This is inside the controller:
$scope.$on('$locationChangeSuccess', function () {;
$scope.searchQuery = $location.search()['q'];
$scope.search();
});
EDIT:
Adding $locationProvider.hashPrefix('!');
will not work because it will only add a "!" after the "#" in the url.
See image from angular docs: