Closed tbosch closed 11 years ago
Reason: when angular fires the $locationChangeStart
event, it saved the replace
flag before broadcasting the event. However, the adapter wants to modify this flag in the event handler...
Here is a workaround for this:
var mod = angular.module("ngm", []);
mod.config(function($provide) {
$provide.decorator('$browser', ['$delegate', function($browser) {
var _url = $browser.url;
$browser.url = function(url, replace) {
var oldUrl = _url.call();
if (url && oldUrl.indexOf('&ui-state=dialog')!==-1) {
console.log("now");
replace = true;
return _url.call(this, url, replace);
}
return _url.apply(this, arguments);
};
return $browser;
}]);
});
Hi, when linking to a page from a dialog and pressing the browser back button, the url updates to something with
&ui-state=dialog
, but the current page is not changing. When the back button is hit the second time, the page before the dialog appears as wanted. I.e. not showing the dialog is correct, but hitting the back button twice is one time too much.JsFiddle: http://jsfiddle.net/ZHKBA/87/
Tobias