@greg.kindel の回避策 (受け入れられた解決策) はうまくいきませんでした。無限のダイジェスト ループに関する多くのエラーがスローされました。Angular 1.5.8 を使用しています。
その回避策を次のように調整して、機能させることができました。それが他の誰かの悲しみを救うことを願っています。
angular.module('sample', [])
.config(['$provide', function ($provide) {
$provide.decorator('$browser', ['$delegate', '$window', function ($delegate, $window) {
$delegate.onUrlChange = function () {};
//
// HACK to stop Angular routing from manipulating the URL
//
// The url() function seems to get used in two different modes.
//
// Mode 1 - Zero arguments
// There are no arguments given, in which case it appears that the caller is expected the
// browser's current URL (a string response).
//
// Mode 2 - Three arguments
// It receives three arguments (url, some_boolean, null). It seems the caller is expecting
// the browser's URL to be updated to the given value. The result of this function call is
// expected to be the $delegate itself, which will subsequently get called with no arguments
// to check the browser's URL.
//
// The Hack:
// We save the URL so that we can lie to the caller that the URL has been updated to what was
// requested, but in reality, we'll do nothing to alter the URL.
//
var savedUrl = null
$delegate.url = function (url, ...args) {
if (!!url) {
savedUrl = url;
return $delegate;
} else {
return !!savedUrl ? savedUrl : $window.location.href;
}
};
return $delegate;
}]);
}])