Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

IE8, html5Mode route to root error & fix #6832

Closed
@LorDOniX

Description

@LorDOniX

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 ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions