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

fix($location) : initialize locationPrototype.$$absUrl to empty string #14488

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/ng/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {

var locationPrototype = {

/**
* Ensure absolute url is initialized.
* @private
*/
$$absUrl:'',

/**
* Are we in html5 mode?
* @private
Expand Down
12 changes: 12 additions & 0 deletions test/ng/locationSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2537,6 +2537,18 @@ describe('$location', function() {
it('should throw on url(urlString, stateObject)', function() {
expectThrowOnStateChange(locationUrl);
});

it('should not throw when base path is another domain', function() {
initService({html5Mode:true,hashPrefix: '!',supportHistory: true});
inject(
initBrowser({url:'http://domain.com/base/',basePath: 'http://otherdomain.com/base/'}),
function($location) {
expect(function() {
$location.absUrl();
}).not.toThrow();
}
);
});
});


Expand Down