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

Commit 5dcf9bb

Browse files
committed
browser is now injectable into the system
1 parent a80a618 commit 5dcf9bb

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
lines changed

src/Angular.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,6 @@ function angularAlert(){
3333
log(arguments); window.alert.apply(window, arguments);
3434
}
3535

36-
extend(angular, {
37-
'compile': compile,
38-
'copy': copy,
39-
'extend': extend,
40-
'foreach': foreach,
41-
'noop':noop,
42-
'identity':identity,
43-
'isUndefined': isUndefined,
44-
'isDefined': isDefined,
45-
'isString': isString,
46-
'isFunction': isFunction,
47-
'isNumber': isNumber,
48-
'isArray': isArray,
49-
'alert': angularAlert
50-
});
51-
5236
function foreach(obj, iterator, context) {
5337
var key;
5438
if (obj) {

src/AngularPublic.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
extend(angular, {
2+
'element': jqLite,
3+
'compile': compile,
4+
'scope': createScope,
5+
'copy': copy,
6+
'extend': extend,
7+
'foreach': foreach,
8+
'noop':noop,
9+
'identity':identity,
10+
'isUndefined': isUndefined,
11+
'isDefined': isDefined,
12+
'isString': isString,
13+
'isFunction': isFunction,
14+
'isNumber': isNumber,
15+
'isArray': isArray
16+
});
17+

src/Browser.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Browser.prototype = {
3737
existingURL += '#';
3838
if (existingURL != url)
3939
this.location.href = url;
40-
this.existingURL = url;
4140
},
4241

4342
getUrl: function() {

src/angular-bootstrap.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
addScript("/Parser.js");
4848
addScript("/Resource.js");
4949
addScript("/Browser.js");
50+
addScript("/AngularPublic.js");
5051

5152
// Extension points
5253
addScript("/apis.js");

src/services.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ angularService("$location", function(browser){
2424
}
2525
}
2626
var hashKeyValue = toKeyValue(location.hashSearch);
27-
return location.href +
28-
(location.hashPath ? location.hashPath : '') +
27+
var hash = (location.hashPath ? location.hashPath : '') +
2928
(hashKeyValue ? '?' + hashKeyValue : '');
29+
return location.href.split('#')[0] + '#' + (hash ? hash : '');
3030
}
3131
browser.watchUrl(function(url){
3232
location(url);

test/servicesSpec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("services", function(){
2424
scope.$location.hashPath = 'page=http://path';
2525
scope.$location.hashSearch = {k:'a=b'};
2626

27-
expect(scope.$location()).toEqual('http://host:123/p/a/t/h.html?query=value#path?key=valuepage=http://path?k=a%3Db');
27+
expect(scope.$location()).toEqual('http://host:123/p/a/t/h.html?query=value#page=http://path?k=a%3Db');
2828
});
2929

3030
it('should parse file://', function(){
@@ -39,7 +39,7 @@ describe("services", function(){
3939
expect(scope.$location.hashPath).toEqual('');
4040
expect(scope.$location.hashSearch).toEqual({});
4141

42-
expect(scope.$location()).toEqual('file:///Users/Shared/misko/work/angular.js/scenario/widgets.html');
42+
expect(scope.$location()).toEqual('file:///Users/Shared/misko/work/angular.js/scenario/widgets.html#');
4343
});
4444

4545
xit('should add stylesheets', function(){

0 commit comments

Comments
 (0)