IE8, html5Mode route to root error & fix #6832
Description
Hi,
I was testing route with html5Mode(true) in IE8. Angular for IE8 sets html5Mode to false and uses hashbang, instead of HTML5 history API.
But problem is when you route to the root url of your site, nothing is shown.
router:
$routeProvider.
when('/', {
templateUrl: '/partials/phone-list.html',
controller: 'PhoneListCtrl'
}).
otherwise({redirectTo: '/'});
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
I found out the solution for this problem:
function LocationHashbangUrl(appBase, hashPrefix) {
and inside function:
this.$$parse = function(url) {
if (!url) {
url = appBase;
}
I've added three lines which contains check for empty url - when you route to the root of your website.
Can be this fix included to the next 1.2.x version of AngularJS ?