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

Commit 22fb275

Browse files
committed
Merge branch 'master' of https://github.com/angular/angular.js into add-offset-to-$anchorScroll
Conflicts: src/ng/anchorScroll.js
2 parents 4e0e4f1 + 0d3b69a commit 22fb275

37 files changed

+1529
-312
lines changed

CHANGELOG.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,125 @@
1+
<a name="1.3.0-rc.5"></a>
2+
# 1.3.0-rc.5 impossible-choreography (2014-10-08)
3+
4+
5+
## Bug Fixes
6+
7+
- **$animate:**
8+
- ensure class-based animations only consider the most recent DOM operations
9+
([c93924ed](https://github.com/angular/angular.js/commit/c93924ed275a62683b85c82f1c6c2e19d5662c9a),
10+
[#8946](https://github.com/angular/angular.js/issues/8946), [#9458](https://github.com/angular/angular.js/issues/9458))
11+
- abort class-based animations if the element is removed during digest
12+
([613d0a32](https://github.com/angular/angular.js/commit/613d0a3212de8dc01c817ca8526e09c57978a621),
13+
[#8796](https://github.com/angular/angular.js/issues/8796))
14+
- clear the GCS cache even when no animation is detected
15+
([cb85cbce](https://github.com/angular/angular.js/commit/cb85cbcec1c876db6062a0dc0bad80f842782194),
16+
[#8813](https://github.com/angular/angular.js/issues/8813))
17+
- **$browser:**
18+
- Cache `location.href` only during page reload phase
19+
([8ee1ba4b](https://github.com/angular/angular.js/commit/8ee1ba4b94d6fccff06d8781f7ed256c6ce664ff),
20+
[#9235](https://github.com/angular/angular.js/issues/9235), [#9455](https://github.com/angular/angular.js/issues/9455))
21+
- don’t use the history API when only the hash changes
22+
([7cb01a80](https://github.com/angular/angular.js/commit/7cb01a80beec669d8f6aae1dc211d2f0b7d4eac4),
23+
[#9423](https://github.com/angular/angular.js/issues/9423), [#9424](https://github.com/angular/angular.js/issues/9424),
24+
[858360b6](https://github.com/angular/angular.js/commit/858360b680a2bb5c19429c1be1c9506700cda476),
25+
[0656484d](https://github.com/angular/angular.js/commit/0656484d3e709c5162570b0dd6473b0b6140e5b2),
26+
[#9143](https://github.com/angular/angular.js/issues/9143), [#9406](https://github.com/angular/angular.js/issues/9406))
27+
- handle async href on url change in <=IE9
28+
([404b95fe](https://github.com/angular/angular.js/commit/404b95fe30a1bcd1313adafbd0018578d5b21d3d),
29+
[#9235](https://github.com/angular/angular.js/issues/9235))
30+
- **$compile:**
31+
- handle the removal of an interpolated attribute
32+
([a75546af](https://github.com/angular/angular.js/commit/a75546afdf41adab786eda30c258190cd4c5f1ae),
33+
[#9236](https://github.com/angular/angular.js/issues/9236), [#9240](https://github.com/angular/angular.js/issues/9240))
34+
- remove comment nodes from templates before asserting single root node
35+
([feba0174](https://github.com/angular/angular.js/commit/feba0174db0f8f929273beb8b90691734a9292e2),
36+
[#9212](https://github.com/angular/angular.js/issues/9212), [#9215](https://github.com/angular/angular.js/issues/9215))
37+
- use the correct namespace for transcluded svg elements
38+
([f3539f3c](https://github.com/angular/angular.js/commit/f3539f3cb5d9477f50f065c6a0ac7d6ca0a31092),
39+
[#9344](https://github.com/angular/angular.js/issues/9344), [#9415](https://github.com/angular/angular.js/issues/9415))
40+
- **$http:** honor application/json response header and parse json primitives
41+
([7b6c1d08](https://github.com/angular/angular.js/commit/7b6c1d08aceba6704a40302f373400aed9ed0e0b),
42+
[#2973](https://github.com/angular/angular.js/issues/2973))
43+
- **$location:** allow `0` in `path()` and `hash()`
44+
([b8c5b871](https://github.com/angular/angular.js/commit/b8c5b87119a06edb8e8d1cefad81ee8d1f64f070))
45+
- **form:** fix submit prevention
46+
([86c7d122](https://github.com/angular/angular.js/commit/86c7d1221c706993044583d51a0c61423fee5bcf),
47+
[#3370](https://github.com/angular/angular.js/issues/3370), [#3776](https://github.com/angular/angular.js/issues/3776))
48+
- **ngAnimate:** defer DOM operations for changing classes to postDigest
49+
([667183a8](https://github.com/angular/angular.js/commit/667183a8c79d6ffce571a2be78c05dc76503b222),
50+
[#8234](https://github.com/angular/angular.js/issues/8234), [#9263](https://github.com/angular/angular.js/issues/9263))
51+
- **orderBy:** sort by identity if no predicate is given
52+
([607f016a](https://github.com/angular/angular.js/commit/607f016a0ba705ce40df0164360fb96a9d7f5912),
53+
[#5847](https://github.com/angular/angular.js/issues/5847), [#4579](https://github.com/angular/angular.js/issues/4579), [#9403](https://github.com/angular/angular.js/issues/9403))
54+
- **select:**
55+
- throw for `selectAs` and `trackBy`
56+
([30996f82](https://github.com/angular/angular.js/commit/30996f82afa03cd11771b3267e9367ecf9af6e6d))
57+
- use `$viewValue` instead of `$modelValue`
58+
([f7174169](https://github.com/angular/angular.js/commit/f7174169f4f710d605f6a67f39f90a67a07d4cab),
59+
[#8929](https://github.com/angular/angular.js/issues/8929))
60+
61+
62+
## Features
63+
64+
- **$location:**
65+
- add support for History API state handling ([6fd36dee](https://github.com/angular/angular.js/commit/6fd36deed954b338e48390862971d465148dc1f2),
66+
[#9027](https://github.com/angular/angular.js/issues/9027))
67+
- allow automatic rewriting of links to be disabled
68+
([b3e09be5](https://github.com/angular/angular.js/commit/b3e09be58960b913fee3869bf36e7de3305bbe00),
69+
[#5487](https://github.com/angular/angular.js/issues/5487))
70+
71+
72+
## Performance Improvements
73+
74+
- **$animate:**
75+
- access DOM less in resolveElementClasses
76+
([22358cf9](https://github.com/angular/angular.js/commit/22358cf9c703d67f3cf9eb4899404b09578a5fad))
77+
- don't join classes before it's necessary in resolveElementClasses
78+
([003c44ec](https://github.com/angular/angular.js/commit/003c44eceee54c3398b0d2971fd97a512d7f7cec))
79+
- **ngBind:** set textContent rather than using element.text()
80+
([074a146d](https://github.com/angular/angular.js/commit/074a146d8b1ee7c93bf6d5892448a5c2a0143a28),
81+
[#9369](https://github.com/angular/angular.js/issues/9369), [#9396](https://github.com/angular/angular.js/issues/9396))
82+
83+
84+
## Breaking Changes
85+
86+
- **$compile:** due to [feba0174](https://github.com/angular/angular.js/commit/feba0174db0f8f929273beb8b90691734a9292e2),
87+
88+
89+
If a template contains directives within comment nodes, and there is more than a single node in the
90+
template, those comment nodes are removed. The impact of this breaking change is expected to be
91+
quite low.
92+
93+
Closes #9212
94+
Closes #9215
95+
96+
- **ngAnimate:** due to [667183a8](https://github.com/angular/angular.js/commit/667183a8c79d6ffce571a2be78c05dc76503b222),
97+
98+
99+
The `$animate` CSS class API will always defer changes until the end of the next digest. This allows ngAnimate
100+
to coalesce class changes which occur over a short period of time into 1 or 2 DOM writes, rather than
101+
many. This prevents jank in browsers such as IE, and is generally a good thing.
102+
103+
If you find that your classes are not being immediately applied, be sure to invoke `$digest()`.
104+
105+
Closes #8234
106+
Closes #9263
107+
108+
- **$select:** due to [30996f8](https://github.com/angular/angular.js/commit/30996f82afa03cd11771b3267e9367ecf9af6e6d)
109+
110+
`ngOptions` will now throw an error when the comprehension expressions contains both a `select as`
111+
and `track by` expression.
112+
113+
These expressions are fundamentally incompatible because it is not possible to reliably and
114+
consistently determine the parent object of a model, since `select as` can assign any child of a
115+
`value` as the model value.
116+
117+
Prior to refactorings in this release, neither of these expressions worked correctly independently,
118+
and did not work at all when combined.
119+
120+
See #6564
121+
122+
1123
<a name="1.3.0-rc.4"></a>
2124
# 1.3.0-rc.4 unicorn-hydrafication (2014-10-01)
3125

css/angular.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak],
44
.ng-cloak, .x-ng-cloak,
5-
.ng-hide:not(.ng-animate) {
5+
.ng-hide:not(.ng-hide-animate) {
66
display: none !important;
77
}
88

docs/content/error/$injector/modulerr.ngdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ This error occurs when a module fails to load due to some exception. The error
77
message above should provide additional context.
88

99
In AngularJS `1.2.0` and later, `ngRoute` has been moved to its own module.
10-
If you are getting this error after upgrading to `1.2.x`, be sure that you've
10+
If you are getting this error after upgrading to `1.2.x` or later, be sure that you've
1111
installed {@link ngRoute `ngRoute`}.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
@ngdoc error
2+
@name $injector:undef
3+
@fullName Undefined Value
4+
@description
5+
6+
This error results from registering a factory which does not return a value (or whose return value is undefined).
7+
8+
The following is an example of a factory which will throw this error upon injection:
9+
10+
```js
11+
angular.module("badModule", []).
12+
factory("badFactory", function() {
13+
doLotsOfThings();
14+
butDontReturnAValue();
15+
});
16+
```
17+
18+
In order to prevent the error, return a value of some sort, such as an object which exposes an API for working
19+
with the injected object.
20+
21+
```js
22+
angular.module("goodModule", []).
23+
factory("goodFactory", function() {
24+
doLotsOfThings();
25+
butDontReturnAValue();
26+
27+
return {
28+
doTheThing: function methodThatDoesAThing() {
29+
}
30+
};
31+
});
32+
```
33+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
@ngdoc error
2+
@name ngOptions:trkslct
3+
@fullName Comprehension expression cannot contain both `select as` and `track by` expressions.
4+
@description
5+
6+
This error occurs when 'ngOptions' is passed a comprehension expression that contains both a
7+
`select as` expression and a `track by` expression. These two expressions are fundamentally
8+
incompatible.
9+
10+
* Example of bad expression: `<select ng-options="item.subItem as item.label for item in values track by item.id" ng-model="selected">`
11+
`values: [{id: 1, label: 'aLabel', subItem: {name: 'aSubItem'}}, {id: 2, label: 'bLabel', subItem: {name: 'bSubItem'}}]`,
12+
`$scope.selected = {name: 'aSubItem'};`
13+
* track by is always applied to `value`, with purpose to preserve the selection,
14+
(to `item` in this case)
15+
* To calculate whether an item is selected, `ngOptions` does the following:
16+
1. apply `track by` to the values in the array:
17+
In the example: [1,2]
18+
2. apply `track by` to the already selected value in `ngModel`:
19+
In the example: this is not possible, as `track by` refers to `item.id`, but the selected
20+
value from `ngModel` is `{name: aSubItem}`.
21+
22+
Here's an example of how to make this example work by using `track by` without `select as`:
23+
24+
```
25+
<select ng-model="selected" ng-options="item.label for item in values track by item.id">
26+
```
27+
28+
Note: This would store the whole `item` as the model to `scope.selected` instead of `item.subItem`.
29+
30+
For more information on valid expression syntax, see 'ngOptions' in {@link ng.directive:select select} directive docs.

docs/content/guide/animations.ngdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Animations
88

9-
AngularJS 1.2 provides animation hooks for common directives such as `ngRepeat`, `ngSwitch`, and `ngView`, as well as custom directives
9+
AngularJS 1.3 provides animation hooks for common directives such as `ngRepeat`, `ngSwitch`, and `ngView`, as well as custom directives
1010
via the `$animate` service. These animation hooks are set in place to trigger animations during the life cycle of various directives and when
1111
triggered, will attempt to perform a CSS Transition, CSS Keyframe Animation or a JavaScript callback Animation (depending on if an animation is
1212
placed on the given directive). Animations can be placed using vanilla CSS by following the naming conventions set in place by AngularJS

docs/content/tutorial/step_07.ngdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ We are using [Bower][bower] to install client side dependencies. This step upda
3333
"license": "MIT",
3434
"private": true,
3535
"dependencies": {
36-
"angular": "1.2.x",
37-
"angular-mocks": "~1.2.x",
38-
"jquery": "1.10.2",
36+
"angular": "~1.3.0",
37+
"angular-mocks": "~1.3.0",
38+
"jquery": "2.1.1",
3939
"bootstrap": "~3.1.1",
40-
"angular-route": "~1.2.x"
40+
"angular-route": "~1.3.0"
4141
}
4242
}
4343
```
4444

45-
The new dependency `"angular-route": "~1.2.x"` tells bower to install a version of the
46-
angular-route component that is compatible with version 1.2.x. We must tell bower to download
45+
The new dependency `"angular-route": "~1.3.0"` tells bower to install a version of the
46+
angular-route component that is compatible with version 1.3.x. We must tell bower to download
4747
and install this dependency.
4848

4949
If you have bower installed globally then you can run `bower install` but for this project we have

docs/content/tutorial/step_11.ngdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ We are using [Bower][bower] to install client side dependencies. This step upda
3232
"license": "MIT",
3333
"private": true,
3434
"dependencies": {
35-
"angular": "1.2.x",
36-
"angular-mocks": "~1.2.x",
35+
"angular": "~1.3.0",
36+
"angular-mocks": "~1.3.0",
3737
"bootstrap": "~3.1.1",
38-
"angular-route": "~1.2.x",
39-
"angular-resource": "~1.2.x"
38+
"angular-route": "~1.3.0",
39+
"angular-resource": "~1.3.0"
4040
}
4141
}
4242
```
4343

44-
The new dependency `"angular-resource": "~1.2.x"` tells bower to install a version of the
45-
angular-resource component that is compatible with version 1.2.x. We must ask bower to download
44+
The new dependency `"angular-resource": "~1.3.0"` tells bower to install a version of the
45+
angular-resource component that is compatible with version 1.3.x. We must ask bower to download
4646
and install this dependency. We can do this by running:
4747

4848
```

docs/content/tutorial/step_12.ngdoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ We are using [Bower][bower] to install client side dependencies. This step upda
3636
"license": "MIT",
3737
"private": true,
3838
"dependencies": {
39-
"angular": "1.2.x",
40-
"angular-mocks": "~1.2.x",
39+
"angular": "~1.3.0",
40+
"angular-mocks": "~1.3.0",
4141
"bootstrap": "~3.1.1",
42-
"angular-route": "~1.2.x",
43-
"angular-resource": "~1.2.x",
44-
"jquery": "1.10.2",
45-
"angular-animate": "~1.2.x"
42+
"angular-route": "~1.3.0",
43+
"angular-resource": "~1.3.0",
44+
"jquery": "~2.1.1",
45+
"angular-animate": "~1.3.0"
4646
}
4747
}
4848
```
4949

50-
* `"angular-animate": "~1.2.x"` tells bower to install a version of the
51-
angular-animate component that is compatible with version 1.2.x.
52-
* `"jquery": "1.10.2"` tells bower to install the 1.10.2 version of jQuery. Note that this is not an
50+
* `"angular-animate": "~1.3.0"` tells bower to install a version of the
51+
angular-animate component that is compatible with version 1.3.x.
52+
* `"jquery": "2.1.1"` tells bower to install the 2.1.1 version of jQuery. Note that this is not an
5353
Angular library, it is the standard jQuery library. We can use bower to install a wide range of 3rd
5454
party libraries.
5555

src/.jshintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@
9292

9393
"skipDestroyOnNextJQueryCleanData": true,
9494

95+
"NODE_TYPE_ELEMENT": false,
96+
"NODE_TYPE_TEXT": false,
97+
"NODE_TYPE_COMMENT": false,
98+
"NODE_TYPE_COMMENT": false,
99+
"NODE_TYPE_DOCUMENT": false,
100+
"NODE_TYPE_DOCUMENT_FRAGMENT": false,
101+
95102
/* filters.js */
96103
"getFirstThursdayOfYear": false,
97104

src/Angular.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@
8383
getBlockNodes: true,
8484
hasOwnProperty: true,
8585
createMap: true,
86+
87+
NODE_TYPE_ELEMENT: true,
88+
NODE_TYPE_TEXT: true,
89+
NODE_TYPE_COMMENT: true,
90+
NODE_TYPE_DOCUMENT: true,
91+
NODE_TYPE_DOCUMENT_FRAGMENT: true,
8692
*/
8793

8894
////////////////////////////////////
@@ -192,7 +198,7 @@ function isArrayLike(obj) {
192198

193199
var length = obj.length;
194200

195-
if (obj.nodeType === 1 && length) {
201+
if (obj.nodeType === NODE_TYPE_ELEMENT && length) {
196202
return true;
197203
}
198204

@@ -1028,11 +1034,9 @@ function startingTag(element) {
10281034
// are not allowed to have children. So we just ignore it.
10291035
element.empty();
10301036
} catch(e) {}
1031-
// As Per DOM Standards
1032-
var TEXT_NODE = 3;
10331037
var elemHtml = jqLite('<div>').append(element).html();
10341038
try {
1035-
return element[0].nodeType === TEXT_NODE ? lowercase(elemHtml) :
1039+
return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :
10361040
elemHtml.
10371041
match(/^(<[^>]+>)/)[1].
10381042
replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });
@@ -1610,3 +1614,9 @@ function getBlockNodes(nodes) {
16101614
function createMap() {
16111615
return Object.create(null);
16121616
}
1617+
1618+
var NODE_TYPE_ELEMENT = 1;
1619+
var NODE_TYPE_TEXT = 3;
1620+
var NODE_TYPE_COMMENT = 8;
1621+
var NODE_TYPE_DOCUMENT = 9;
1622+
var NODE_TYPE_DOCUMENT_FRAGMENT = 11;

src/AngularPublic.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ function publishExternalAPI(angular){
140140
'getTestability': getTestability,
141141
'$$minErr': minErr,
142142
'$$csp': csp,
143-
'reloadWithDebugInfo': reloadWithDebugInfo,
144-
'$$hasClass': jqLiteHasClass
143+
'reloadWithDebugInfo': reloadWithDebugInfo
145144
});
146145

147146
angularModule = setupModuleLoader(window);

src/auto/injector.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,15 +662,29 @@ function createInjector(modulesToLoad, strictDi) {
662662
return providerCache[name + providerSuffix] = provider_;
663663
}
664664

665-
function factory(name, factoryFn) { return provider(name, { $get: factoryFn }); }
665+
function enforceReturnValue(name, factory) {
666+
return function enforcedReturnValue() {
667+
var result = instanceInjector.invoke(factory);
668+
if (isUndefined(result)) {
669+
throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name);
670+
}
671+
return result;
672+
};
673+
}
674+
675+
function factory(name, factoryFn, enforce) {
676+
return provider(name, {
677+
$get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn
678+
});
679+
}
666680

667681
function service(name, constructor) {
668682
return factory(name, ['$injector', function($injector) {
669683
return $injector.instantiate(constructor);
670684
}]);
671685
}
672686

673-
function value(name, val) { return factory(name, valueFn(val)); }
687+
function value(name, val) { return factory(name, valueFn(val), false); }
674688

675689
function constant(name, value) {
676690
assertNotHasOwnProperty(name, 'constant');

0 commit comments

Comments
 (0)