FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix($location) : initialize locationPrototype.$$absUrl to empty string by GuillaumeSalles · Pull Request #14488 · angular/angular.js · GitHub

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

Repository navigation

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 6 additions & 0 deletions src/ng/location.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL