diff options
| -rw-r--r-- | src/Angular.js | 16 | ||||
| -rw-r--r-- | src/AngularPublic.js | 17 | ||||
| -rw-r--r-- | src/Browser.js | 1 | ||||
| -rw-r--r-- | src/angular-bootstrap.js | 1 | ||||
| -rw-r--r-- | src/services.js | 4 | ||||
| -rw-r--r-- | test/servicesSpec.js | 4 |
6 files changed, 22 insertions, 21 deletions
diff --git a/src/Angular.js b/src/Angular.js index 86fb5291..d00a9bf6 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -33,22 +33,6 @@ function angularAlert(){ log(arguments); window.alert.apply(window, arguments); } -extend(angular, { - 'compile': compile, - 'copy': copy, - 'extend': extend, - 'foreach': foreach, - 'noop':noop, - 'identity':identity, - 'isUndefined': isUndefined, - 'isDefined': isDefined, - 'isString': isString, - 'isFunction': isFunction, - 'isNumber': isNumber, - 'isArray': isArray, - 'alert': angularAlert -}); - function foreach(obj, iterator, context) { var key; if (obj) { diff --git a/src/AngularPublic.js b/src/AngularPublic.js new file mode 100644 index 00000000..b9d0f9d7 --- /dev/null +++ b/src/AngularPublic.js @@ -0,0 +1,17 @@ +extend(angular, { + 'element': jqLite, + 'compile': compile, + 'scope': createScope, + 'copy': copy, + 'extend': extend, + 'foreach': foreach, + 'noop':noop, + 'identity':identity, + 'isUndefined': isUndefined, + 'isDefined': isDefined, + 'isString': isString, + 'isFunction': isFunction, + 'isNumber': isNumber, + 'isArray': isArray +}); + diff --git a/src/Browser.js b/src/Browser.js index bdf57386..893459ae 100644 --- a/src/Browser.js +++ b/src/Browser.js @@ -37,7 +37,6 @@ Browser.prototype = { existingURL += '#'; if (existingURL != url) this.location.href = url; - this.existingURL = url; }, getUrl: function() { diff --git a/src/angular-bootstrap.js b/src/angular-bootstrap.js index 7484b0c3..d9633854 100644 --- a/src/angular-bootstrap.js +++ b/src/angular-bootstrap.js @@ -47,6 +47,7 @@ addScript("/Parser.js"); addScript("/Resource.js"); addScript("/Browser.js"); + addScript("/AngularPublic.js"); // Extension points addScript("/apis.js"); diff --git a/src/services.js b/src/services.js index 59c21d36..16b48031 100644 --- a/src/services.js +++ b/src/services.js @@ -24,9 +24,9 @@ angularService("$location", function(browser){ } } var hashKeyValue = toKeyValue(location.hashSearch); - return location.href + - (location.hashPath ? location.hashPath : '') + + var hash = (location.hashPath ? location.hashPath : '') + (hashKeyValue ? '?' + hashKeyValue : ''); + return location.href.split('#')[0] + '#' + (hash ? hash : ''); } browser.watchUrl(function(url){ location(url); diff --git a/test/servicesSpec.js b/test/servicesSpec.js index 49000af4..193351d1 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -24,7 +24,7 @@ describe("services", function(){ scope.$location.hashPath = 'page=http://path'; scope.$location.hashSearch = {k:'a=b'}; - expect(scope.$location()).toEqual('http://host:123/p/a/t/h.html?query=value#path?key=valuepage=http://path?k=a%3Db'); + expect(scope.$location()).toEqual('http://host:123/p/a/t/h.html?query=value#page=http://path?k=a%3Db'); }); it('should parse file://', function(){ @@ -39,7 +39,7 @@ describe("services", function(){ expect(scope.$location.hashPath).toEqual(''); expect(scope.$location.hashSearch).toEqual({}); - expect(scope.$location()).toEqual('file:///Users/Shared/misko/work/angular.js/scenario/widgets.html'); + expect(scope.$location()).toEqual('file:///Users/Shared/misko/work/angular.js/scenario/widgets.html#'); }); xit('should add stylesheets', function(){ |
