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

Commit

Permalink
If you use html5mode on IE9, IE8 it fails with 10 $digest() iteration…
Browse files Browse the repository at this point in the history
…s reached.

There was an issue with location.replace method isn't changing the location.href immediately.
  • Loading branch information
Pavel Vasek committed May 27, 2013
1 parent 5b592cb commit e8f9dd7
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/ng/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ function Browser(window, document, $log, $sniffer) {
// URL API
//////////////////////////////////////////////////////////////

var lastBrowserUrl = location.href,
baseElement = document.find('base');
var lastBrowserUrl = location.href,
baseElement = document.find('base'),
replacedUrl = null;

/**
* @name ng.$browser#url
Expand Down Expand Up @@ -159,14 +160,20 @@ function Browser(window, document, $log, $sniffer) {
baseElement.attr('href', baseElement.attr('href'));
}
} else {
if (replace) location.replace(url);
else location.href = url;
if (replace) {
location.replace(url);
replacedUrl = url;
} else {
location.href = url;
replacedUrl = null;
}
}
return self;
// getter
} else {
// the replacedUrl is a workaround for an issue with location.replace method isn't changing the location.href immediately
// the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172
return location.href.replace(/%27/g,"'");
return replacedUrl || location.href.replace(/%27/g,"'");
}
};

Expand Down

0 comments on commit e8f9dd7

Please sign in to comment.