504 KiB
1.4.0-beta.6 cookie-liberation (2015-03-17)
Bug Fixes
- $animate: call
applyStyles
from options onleave
(4374f892, #10068) - $browser: don't crash if
history.state
access causes error in IE (3b8163b7, #10367, #10369) - $sanitize: disallow unsafe svg animation tags (67688d5c, #11290)
- Angular: properly compare RegExp with other objects for equality (f22e1fc9, #11204, #11205)
- date filter: display localised era for
G
format codes (2b4dfa9e, #10503, #11266) - filterFilter:
- form: allow dynamic form names which initially evaluate to blank (410f7c68)
- jqLite: attr should ignore comment, text and attribute nodes (bb5bf7f8)
- ng/$locale: add ERA info in generic locale (4acb0af2)
- ngJq: don't rely on existence of jqlite (342e5f3c, #11044)
- ngMessages: ensure that multi-level transclusion works with
ngMessagesInclude
(d7ec5f39, #11196) - ngOptions: fix model<->option interaction when using
track by
(6a03ca27, #10869, #10893) - rootScope: prevent memory leak when destroying scopes (fb7db4a0, #11173, #11169)
Features
- $cookies:
- $cookiesProvider: provide path, domain, expires and secure options (53c66369)
- $interval: pass additional arguments to the callback (4f1f9cfd, #10632)
- $timeout: pass additional arguments to the callback (3a4b6b83, #10631)
- angular.merge: provide an alternative to
angular.extend
that merges 'deeply' (c0498d45, #10507, #10519) - filterFilter: compare object with custom
toString()
to primitive (f8c42161, #10464, #10548) - ngAria:
- ngLocale: Add FIRSTDAYOFWEEK and WEEKENDRANGE from google data (3d149c7f)
- ngMock:
- ngModel: support conversion to timezone other than UTC (0413bee8, #11005)
Breaking Changes
- $cookies: due to 38fbe3ee,
$cookies
no longer exposes properties that represent the current browser cookie
values. Now you must explicitly the methods described above to access the cookie
values. This also means that you can no longer watch the $cookies
properties for
changes to the browser's cookies.
This feature is generally only needed if a 3rd party library was programmatically changing the cookies at runtime. If you rely on this then you must either write code that can react to the 3rd party library making the changes to cookies or implement your own polling mechanism.
1.3.15 locality-filtration (2015-03-17)
Bug Fixes
- $animate: call
applyStyles
with options onleave
(ebd84e80, #10068) - $browser: don't crash if history.state access causes error in IE (92767c09, #10367, #10369)
- Angular: properly compare RegExp with other objects for equality (b8e8f9af, #11204, #11205)
- date filter: display localised era for
G
format codes (f2683f95, #10503, #11266) - filterFilter:
- form: allow dynamic form names which initially evaluate to blank (190ea883, #11096)
- ng/$locale: add ERA info in generic locale (57842530)
- rootScope: prevent memory leak when destroying scopes (528cf09e, #11173, #11169)
- templateRequest: avoid throwing syntax error in Android 2.3 (75abbd52, #11089, #11051, #11088)
Features
- ngAria:
- ngMock:
1.4.0-beta.5 karmic-stabilization (2015-02-24)
Bug Fixes
- $http: properly access request headers with mixed case (5da1256f, #10881, #10883)
- input: create max and/or min validator regardless of initial value (c211e7a5, #10307, #10327)
- ngAria: correctly set "checked" attr for checkboxes and radios (d6eba217, #10389, #10212)
- ngModel: fix issues when parserName is same as validator key (056a3170, #10698, #10850, #11046)
- ngOptions: ngModel is optional (ef894c87)
- ngSanitize: Do not ignore white-listed svg camelCased attributes (46b80654, #10779, #10990, #11124)
- select: remove unknown option when model is undefined and empty option is available (30b48132, #11078, #11092)
- templateRequest: avoid throwing syntax error in Android 2.3 (f6272333, #11089, #11051, #11088)
Features
-
CommonJS: - angular modules are now packaged for npm with helpful exports
-
limitTo: extend the filter to take a beginning index argument (aaae3cc4, #5355, #10899)
-
ngMessages: provide support for dynamic message resolution (c9a4421f, #10036, #9338)
-
ngOptions: add support for disabling an option (da9eac86, #638, #11017)
Performance Improvements
- $compile:
- ngOptions: only watch labels if a display expression is specified (51faaffd)
Breaking Changes
- ngMessages: due to c9a4421f,
The ngMessagesInclude
attribute is now its own directive and that must
be placed as a child element within the element with the ngMessages
directive. (Keep in mind that the former behaviour of the
ngMessageInclude attribute was that all included ngMessage template
code was placed at the bottom of the element containing the
ngMessages directive; therefore to make this behave in the same way,
place the element containing the ngMessagesInclude directive at the
end of the container containing the ngMessages directive).
<!-- AngularJS 1.3.x -->
<div ng-messages="model.$error" ng-messages-include="remote.html">
<div ng-message="required">Your message is required</div>
</div>
<!-- AngularJS 1.4.x -->
<div ng-messages="model.$error">
<div ng-message="required">Your message is required</div>
<div ng-messages-include="remote.html"></div>
</div>
1.3.14 instantaneous-browserification (2015-02-24)
Features
- CommonJS: - angular modules are now packaged for npm with helpful exports
Bug Fixes
- input: create max and/or min validator regardless of initial value (abfce532, #10307, #10327)
- ngAria: correctly set "checked" attr for checkboxes and radios (944c150e, #10389, #10212)
- ngModel: fix issues when parserName is same as validator key (6b7625a0, #10698, #10850, #11046)
1.4.0-beta.4 overlyexplosive-poprocks (2015-02-09)
Bug Fixes
- $location: prevent page reload if initial url has empty hash at the end (a509e9aa, #10397, #10960)
- $parse: Initialize elements in an array from left to right (966f6d83)
- ngAria: ensure native controls fire a single click (9d53e5a3, #10388, #10766)
- ngMock: handle cases where injector is created before tests (898714df, #10967)
- sanitize: handle newline characters inside special tags (cc8755cd, 030a42e7 #10943)
Features
- ng-jq: adds the ability to force jqLite or a specific jQuery version (09ee82d8)
1.3.13 meticulous-riffleshuffle (2015-02-09)
Bug Fixes
- $location: prevent page reload if initial url has empty hash at the end (4b3a590b, #10397, #10960)
- ngAria: ensure native controls fire a single click (69ee593f, #10388, #10766)
- ngMock: handle cases where injector is created before tests (39ddef68, #10967)
- sanitize: handle newline characters inside special tags (11aedbd7, ce49d4d6 #10943)
1.4.0-beta.3 substance-mimicry (2015-02-02)
Bug Fixes
- $compile:
- $controller: throw better error when controller expression is bad (dda65e99, #10875, #10910)
- $parse:
- a: don't reload if there is only a name attribute (d729fcf0, #6273, #10880)
- angular.copy: support copying
TypedArray
s (aa0f6449, #10745) - filter: format timezone correctly in the case that UTC timezone is used (8c469191, #9359)
- ngRoute: dont duplicate optional params into query (27bf2ce4, #10689)
- ngScenario: allow ngScenario to handle lazy-loaded and manually bootstrapped applications (c69caa7b, #10723)
- validators: maxlength should use viewValue for $isEmpty (bfcf9946, #10898)
Features
- $compile: allow using bindToController as object, support both new/isolate scopes (35498d70, #10420, #10467)
- filter: support conversion to timezone other than UTC (c6d8512a, #10858)
- ngMocks: cleanup $inject annotations after each test (0baa17a3)
Performance Improvements
- $scope: Add a property $$watchersCount to scope (c1500ea7)
- $parse new and more performant parser (0d42426)
Breaking Changes
- $compile: due to 6a38dbfd, Previously, '&' expressions would always set up a function in the isolate scope. Now, if the binding is marked as optional and the attribute is not specified, no function will be added to the isolate scope.
1.3.12 outlandish-knitting (2015-02-02)
Bug Fixes
- $controller: throw better error when controller expression is bad (632b2ddd, #10875, #10910)
- $parse: remove references to last arguments to a fn call (7caad220, #10894)
- ngRoute: dont duplicate optional params into query (f41ca4a5, #10689)
- ngScenario: Allow ngScenario to handle lazy-loaded and manually bootstrapped applications (0bcd0872, #10723)
- validators: maxlength should use viewValue for $isEmpty (abd8e2a9, #10898)
Features
- ngMocks: cleanup $inject annotations after each test (6ec59460)
1.4.0-beta.2 holographic-rooster (2015-01-26)
Bug Fixes
- $location: don't rewrite when link is shift-clicked (8b33de6f, #9904, #9906)
- $templateRequest: cache downloaded templates as strings (b3a9bd3a, #10630, #10646)
- filterFilter: throw error if input is not an array (cea8e751, #9992, #10352)
- htmlAnchorDirective:
- ngPluralize: fix wrong text content when count is null/undefined (3228d3b4, #10836, #10841)
Breaking Changes
- filterFilter: due to cea8e751, Previously, the filter was not applied if used with a non array. Now, it throws an error. This can be worked around by converting an object to an array, using a filter such as https://github.com/petebacondarwin/angular-toArrayFilter
Closes #9992 Closes #10352
1.3.11 spiffy-manatee (2015-01-26)
Bug Fixes
1.4.0-beta.1 trepidatious-salamander (2015-01-20)
Bug Fixes
- $animate: ensure no transitions are applied when an empty inline style object is provided (0db5b21b, #10613, #10770)
- $compile: support class directives on SVG elements (23c8a90d, #10736, #10756)
- form: clean up success state of controls when they are removed (2408f2de, #10509)
- ngController: allow bound constructor fns as controllers (d17fbc38, #10784, #10790)
- ngRepeat: do not sort object keys alphabetically (c260e738, #6210, #10538)
Features
Breaking Changes
- ngRepeat: due to c260e738,
Previously, the order of items when using ngRepeat to iterate over object properties was guaranteed to be consistent by sorting the keys into alphabetic order.
Now, the order of the items is browser dependent based on the order returned
from iterating over the object using the for key in obj
syntax.
It seems that browsers generally follow the strategy of providing keys in the order in which they were defined, although there are exceptions when keys are deleted and reinstated. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete#Cross-browser_issues
The best approach is to convert Objects into Arrays by a filter such as https://github.com/petebacondarwin/angular-toArrayFilter or some other mechanism, and then sort them manually in the order you need.
Closes #6210 Closes #10538
1.3.10 heliotropic-sundial (2015-01-20)
Bug Fixes
- $animate: ensure no transitions are applied when an empty inline style object is provided (9b8df52a, #10613, #10770)
- $compile: support class directives on SVG elements (7a9e3360, #10736, #10756)
- form: clean up success state of controls when they are removed (cdc7280d, #10509)
- ngController: allow bound constructor fns as controllers (d015c8a8, #10784, #10790)
1.4.0-beta.0 photonic-umbrakinesis (2015-01-13)
Bug Fixes
- $location: support right button click on anchors in firefox (aa798f12, #7984)
- $templateRequest: propagate HTTP status on failed requests (e24f22bd, #10514, #10628)
- dateFilter: ignore invalid dates (1334b8c8, #10640)
- filterFilter: use isArray() to determine array type (a01ce6b8, #10621)
- ngChecked: ensure that ngChecked doesn't interfere with ngModel (e079111b, #10662, #10664)
- ngClass: handle multi-class definitions as an element of an array (e1132f53, #8578, #10651)
- ngModelOptions: allow sharing options between multiple inputs (9c9c6b3f, #10667)
- ngOptions:
- support one-time binding on the option values (ba90261b, #10687, #10694)
- prevent infinite digest if track by expression is stable (fc21db8a, #9464)
- update model if selected option is removed (933591d6, #7736)
- ensure that the correct option is selected when options are loaded async (7fda214c, #8019, #9714, #10639)
- ngPluralize: generate a warning when using a not defined rule (c66b4b6a)
Features
- $filter: display Infinity symbol when number is Infinity (51d67742, #10421)
- $timeout: allow
fn
to be an optional parameter (5a603023, #9176) - limitTo: ignore limit when invalid (a3c3bf33, #10510)
- ngMock/$exceptionHandler: log errors when rethrowing (deb3cb4d, #10540, #10564)
Performance Improvements
Breaking Changes
-
limitTo: due to a3c3bf33, limitTo changed behavior when limit value is invalid. Instead of returning empty object/array it returns unchanged input.
-
ngOptions: due to 7fda214c,
When using ngOptions
: the directive applies a surrogate key as the value of the <option>
element.
This commit changes the actual string used as the surrogate key. We now store a string that is computed
by calling hashKey
on the item in the options collection; previously it was the index or key of the
item in the collection.
(This is in keeping with the way that the unknown option value is represented in the select directive.)
Before you might have seen:
<select ng-model="x" ng-option="i in items">
<option value="1">a</option>
<option value="2">b</option>
<option value="3">c</option>
<option value="4">d</option>
</select>
Now it will be something like:
<select ng-model="x" ng-option="i in items">
<option value="string:a">a</option>
<option value="string:b">b</option>
<option value="string:c">c</option>
<option value="string:d">d</option>
</select>
If your application code relied on this value, which it shouldn't, then you will need to modify your
application to accommodate this. You may find that you can use the track by
feaure of ngOptions
as this provides the ability to specify the key that is stored.
- ngOptions: due to 7fda214c,
When iterating over an object's properties using the (key, value) in obj
syntax
the order of the elements used to be sorted alphabetically. This was an artificial
attempt to create a deterministic ordering since browsers don't guarantee the order.
But in practice this is not what people want and so this change iterates over properties
in the order they are returned by Object.keys(obj), which is almost always the order
in which the properties were defined.
1.3.9 multidimensional-awareness (2015-01-13)
Bug Fixes
- $parse: allow use of locals in assignments (86900814)
- filterFilter: use isArray() to determine array type (d4b60ada, #10621)
Features
Performance Improvements
1.3.8 prophetic-narwhal (2014-12-19)
Bug Fixes
- filterFilter:
- ngAria: trigger digest on
ng-click
via keypress, pass$event
to expression (924e68c7, #10442, #10443, #10447) - orderBy: compare timestamps when sorting date objects (661f6d9e, #10512, #10516)
Performance Improvements
- limitTo: replace for loop with slice (cd77c089)
1.3.7 leaky-obstruction (2014-12-15)
Bug Fixes
- $compile: use
createMap()
for$$observe
listeners when initialized from attr interpolation (8e28bb4c) - $http:
- $parse: a chain of field accessors should use a single
getterFn
(c90ad968) - ngRepeat: allow extra whitespaces in
(key,value)
part of micro-syntax (ef640cbc, #6827, #6833) - orderBy: do not try to call
valueOf
/toString
onnull
(a097aa95, #10385, #10386)
Features
- $compile: add support for
ng-attr
with camelCased attributes (d8e37078, #9845, #10194) - $http: pass response status code to data transform functions (1b740974, #10324, #6734, #10440)
- $rootScope: allow passing
locals
argument to$evalAsync
(9b96cea4, #10390)
Performance Improvements
- $compile: only re-
$interpolate
attribute values at link time if changed since compile (9ae0c01c)
Breaking Changes
- orderBy: due to a097aa95,
Previously, if either value being compared in the orderBy comparator was null or undefined, the
order would, incorrectly, not change. Now, this order behaves more like Array.prototype.sort, which
by default pushes null
behind objects, due to n
occurring after [
(the first characters of their
stringified forms) in ASCII / Unicode. If toString
is customized, or does not exist, the
behaviour is undefined.
1.2.28 finnish-disembarkation (2014-12-15)
Bug Fixes
- $route: fix redirection with optional/eager params (1b9e408d, #9742, #10202)
- linky: encode double quotes when serializing email addresses (929dd15b, #8945, #8964, #5946, #10090, #9256)
1.3.6 robofunky-danceblaster (2014-12-08)
Bug Fixes
- $browser: prevent infinite digests when clearing the hash of a url (10ac5948, #9629, #9635, #10228, #10308)
- $http: preserve config object when resolving from cache (facfec98, #9004, #9030)
- $location:
- $parse:
- filterFilter:
- inputs: ignoring input events in IE caused by placeholder changes or focus/blur on inputs with placeholders (55d9db56, #9265)
- linky: make urls starting with www. links, like markdown (915a891a, #10290)
- ngAnimate: do not use jQuery class API (40a537c2, #10024, #10329)
- ngMock: allow numeric timeouts in $httpBackend mock (acb066e8, #4891)
- ngModel:
- ngSanitize: exclude smart quotes at the end of the link (7c6be43e, #7307)
- numberFilter: numbers rounding to zero shouldn't be negative (96c61fe7, #10278)
- orderBy:
Features
- $$jqLite: export jqLite as a private service (f2e7f875)
- $injector: print caller name in "unknown provider" errors (when available) (013b522c, #8135, #9721)
- jsonFilter: add optional arg to define custom indentation (1191edba, #9771)
- ngAria: bind keypress on ng-click w/ option (5481e2cf, #10288)
Breaking Changes
- $location: due to 2dc34a96,
We no longer throw an ihshprfx
error if the URL after the base path
contains only a hash fragment. Previously, if the base URL was http://abc.com/base/
and the hashPrefix is !
then trying to parse http://abc.com/base/#some-fragment
would have thrown an error. Now we simply assume it is a normal fragment and
that the path is empty, resulting $location.absUrl() === "http://abc.com/base/#!/#some-fragment"
.
This should not break any applications, but you can no longer rely on receiving the
ihshprfx
error for paths that have the syntax above. It is actually more similar
to what currently happens for invalid extra paths anyway: If the base URL
and hashPrfix are set up as above, then http://abc.com/base/other/path
does not
throw an error but just ignores the extra path: http://abc.com/base
.
-
filterFilter: due to a75537d4,
Named properties in the expression object will only match against properties on the same level. Previously, named string properties would match against properties on the same level or deeper.
Before:
arr = filterFilter([{level1: {level2: 'test'}}], {level1: 'test'}); // arr.length -> 1
After:
arr = filterFilter([{level1: {level2: 'test'}}], {level1: 'test'}); // arr.length -> 0
In order to match deeper nested properties, you have to either match the depth level of the property or use the special
$
key (which still matches properties on the same level or deeper). E.g.:// Both examples below have `arr.length === 1` arr = filterFilter([{level1: {level2: 'test'}}], {level1: {level2: 'test'}}); arr = filterFilter([{level1: {level2: 'test'}}], {$: 'test'});
1.3.5 cybernetic-mercantilism (2014-12-01)
Bug Fixes
- $templateRequest: propagate rejection reason when ignoreRequestError flag is set (f6458826, #10266)
- $httpBackend: allow canceling request with falsy timeoutId (719d5c5f, #10177)
- linky: encode all double quotes when serializing email addresses (2ec8d1ff, #10090)
- ngMock:
- select:
1.3.4 highfalutin-petroglyph (2014-11-24)
Bug Fixes
- $browser: allow chaining url() calls in setter mode (764fa869, #10157)
- $http: return empty headers, ignore properties in Object prototype (637c020f, #7779, #10113, #10091)
- $locale: Allow currency filter to fall back to maxFrac from locale (6dbd606a, #10179)
- $location: allow empty string URLs to reset path, search, and hash (7812dfce, #10063, #10064)
- $route: fix redirection with optional/eager params (891acf4c, #9819, #9827)
- Angular: properly get node name for svg element wrapper (09a98323, #10078, #10172)
- NgModelController: typo $rawModelValue -> $$rawModelValue (4f4ff5f3)
- input:
- inputdate: do not use
$isEmpty
to check the model validity (40406e2f) - linky: encode double quotes when serializing email addresses (8ee8ffeb, #8945, #8964, #5946, #10090, #9256)
- ngMaxlength: ignore maxlength when not set to a non-negative integer (92f87b11, #9874)
- ngModel: don't run parsers when executing $validate (e3764e30)
- ngModelOptions: preserve context of getter/setters (bb4d3b73, #9394, #9865)
Features
- ngMaxlength: add support for disabling max length limit (5c1fdff6, #9995)
- ngModelController: add $setDirty method (e8941c0f, #10038, #10049)
- ngPluralize: add support for
count
to be a one-time expression (2b41a586, #10004)
Performance Improvements
Breaking Changes
- ngModelOptions: due to bb4d3b73, previously, ngModel invoked getter/setters in the global context.
For example:
<input ng-model="model.value" ng-model-options="{ getterSetter: true }">
would previously invoke model.value()
in the global context.
Now, ngModel invokes value
with model
as the context.
It's unlikely that real apps relied on this behavior. If they did they can use .bind
to explicilty
bind a getter/getter to the global context, or just reference globals normally without this
.
1.2.27 prime-factorization (2014-11-20)
Bug Fixes
- $animate: clear the GCS cache even when no animation is detected (f619d032, #8813)
- $browser:
- $http: add missing shortcut methods and missing docs (ec4fe1bc, #9180, #9321)
- $location:
- $parse: add quick check for Function constructor in fast path (756640f5)
- $parse, events: prevent accidental misuse of properties on $event (4d0614fd, #9969)
- ngMock: $httpBackend should match data containing Date objects correctly (1426b029, #5127)
- orderBy: sort by identity if no predicate is given (45b896a1, #5847, #4579, #9403)
- select: ensure the label attribute is updated in Internet Explorer (16833d0f, #9621, #10042)
Performance Improvements
1.3.3 undersea-arithmetic (2014-11-17)
Bug Fixes
- $http: don't parse single space responses as JSON (6f19a6fd, #9907)
- minErr: stringify non-JSON compatible objects in error messages (cf43ccdf, #10085)
- $rootScope: handle cyclic references in scopes when creating error messages (e80053d9, #10085)
- ngRepeat: support cyclic object references in error messages (fa12c3c8, #9838, #10065, #10085)
- ngMock: call $interval callbacks even when invokeApply is false (d81ff888, #10032)
- ngPattern: match behaviour of native HTML pattern attribute (85eb9660, #9881, #9888)
- select: ensure the label attribute is updated in Internet Explorer (6604c236, #9621, #10042)
Features
- $location: allow to location to be changed during $locationChangeStart (a9352c19, #9607, #9678)
- $routeProvider: allow setting caseInsensitiveMatch on the provider (0db573b7, #6477, #9873)
Performance Improvements
Breaking Changes
- $parse: due to fbad2805,
you can't use characters that have special meaning in AngularJS expressions (ex.:
.
or-
) as part of filter's name. Before this commit custom filters could contain special characters (like a dot) in their name but this wasn't intentional.
1.3.2 cardiovasculatory-magnification (2014-11-07)
Bug Fixes
- $compile: do not rebind parent bound transclude functions (841c0907, #9413)
- $parse:
- $parse, events: prevent accidental misuse of properties on $event (e057a9aa)
- ngRoute: allow proto inherited properties in route params object (b4770582, #8181, #9731)
- select: use strict comparison for isSelected with selectAs (9e305948, #9639, #9949)
Features
- ngAria: announce ngMessages with aria-live (187e4318, #9834)
- ngMock: decorator that adds Scope#$countChildScopes and Scope#$countWatchers (74981c9f, #9926, #9871)
Security Note
This release also contains security fixes for expression sandbox bypasses.
These issues affect only applications with known server-side XSS holes that are also using CSP to secure their client-side code. If your application falls into this rare category, we recommend updating your version of Angular.
We'd like to thank security researches Sebastian Lekies, Jann Horn, and Gábor Molnár for reporting these issues to us.
We also added a documentation page focused on security, which contains some of the best practices, DOs and DON'Ts. Please check out https://docs.angularjs.org/guide/security.
1.3.1 spectral-lobster (2014-10-31)
Bug Fixes
- $compile: returning null when an optional controller is not found (2cd5b4ec, #9404, #9392)
- $observe: check if the attribute is undefined (531a8de7, #9707, #9720)
- $parse: support dirty-checking objects with null prototype (28661d1a, #9568)
- $sce: use msie instead of $document[0].documentMode (45252c3a, #9661)
- $templateRequest: ignore JSON Content-Type header and content (1bd473eb, #5756, #9619)
- i18n: rename datetimeSymbols to be camelCase (94f5a285)
- loader: fix double spaces (8b2f1a47, #9630)
- ngMock: $httpBackend should match data containing Date objects correctly (1025f6eb, #5127)
- ngSanitize: attribute name: xmlns:href -> xlink:href (4cccf0f2, #9769)
- select: assign result of track exp to element value (4b4098bf, #9718, #9592)
- templateRequest: allow empty html template (52ceec22, #9581)
- testability: escape regex chars in
findBindings
if usingexactMatch
(02aa4f4b, #9595, #9600)
Features
- $compile: allow $watchCollection to be used in bi-directional bindings (40bbc981, #9725)
- ngSanitize: accept SVG elements and attributes (a54b25d7, #9578, #9751)
1.3.0 superluminal-nudge (2014-10-13)
Bug Fixes
- $browser:
- $http:
- $injector: ensure $get method invoked with provider context (372fa699, #9511, #9512)
- $location: use clone of passed search() object (c7a9009e, #9445)
- $parse: stabilize one-time literal expressions correctly (874cac82)
- formController: remove scope reference when form is destroyed (01f50e1a, #9315)
- jqLite: remove native listener when all jqLite listeners were deregistered (d71fb6f2, #9509)
- select:
Features
- $anchorScroll: support a configurable vertical scroll offset (09c39d2c, #9368, #2070, #9360)
- $animate:
- currencyFilter: add fractionSize as optional parameter (20685ffe, #3642, #3461, #3642, #7922)
- jqLite: add private jqLiteDocumentLoaded function (0dd316ef)
Breaking Changes
- $animate: due to e5f4d7b1,
staggering animations that use transitions will now
always block the transition from starting (via
transition: 0s none
) up until the stagger step kicks in. The former behaviour was that the block was removed as soon as the pending class was added. This fix allows for styles to be applied in the pending class without causing an animation to trigger prematurely.
1.3.0-rc.5 impossible-choreography (2014-10-08)
Bug Fixes
- $anchorScroll: don't scroll to top when initializing and location hash is empty (d5445c60, #8848, #9393)
- $animate:
- ensure hidden elements with ngShow/ngHide stay hidden during animations (39d0b368, #9103, #9493)
- permit class-based animations for leave operations if ngAnimateChildren is enabled (df1a00b1, #8092, #9491)
- ensure that class-based animations only consider the most recent DOM operations (c93924ed, #8946, #9458)
- abort class-based animations if the element is removed during digest (613d0a32, #8796)
- clear the GCS cache even when no animation is detected (cb85cbce, #8813)
- $browser:
- $compile:
- $http: honor application/json response header and parse json primitives (7b6c1d08, #2973)
- $injector: throw when factory $get method does not return a value (0d3b69a5, #4575, #9210)
- $location: allow
0
inpath()
andhash()
(b8c5b871) - form: fix submit prevention (86c7d122, #3370, #3776)
- ngAnimate: defer DOM operations for changing classes to postDigest (667183a8, #8234, #9263)
- orderBy: sort by identity if no predicate is given (607f016a, #5847, #4579, #9403)
- select:
Features
Performance Improvements
Breaking Changes
- $compile: due to feba0174,
If a template contains directives within comment nodes, and there is more than a single node in the template, those comment nodes are removed. The impact of this breaking change is expected to be quite low.
Closes #9212 Closes #9215
- ngAnimate: due to 667183a8,
The $animate
CSS class API will always defer changes until the end of the next digest. This allows ngAnimate
to coalesce class changes which occur over a short period of time into 1 or 2 DOM writes, rather than
many. This prevents jank in browsers such as IE, and is generally a good thing.
If you find that your classes are not being immediately applied, be sure to invoke $digest()
.
Closes #8234 Closes #9263
- $select: due to 30996f8
ngOptions
will now throw an error when the comprehension expressions contains both a select as
and track by
expression.
These expressions are fundamentally incompatible because it is not possible to reliably and
consistently determine the parent object of a model, since select as
can assign any child of a
value
as the model value.
Prior to refactorings in this release, neither of these expressions worked correctly independently, and did not work at all when combined.
See #6564
- $route: due to f4ff11b0,
Order of events has changed.
Previously: $locationChangeStart
-> $locationChangeSuccess
-> $routeChangeStart
-> $routeChangeSuccess
Now: $locationChangeStart
-> $routeChangeStart
-> $locationChangeSuccess
-> -> $routeChangeSuccess
Fixes #5581 Closes #5714 Closes #9502
1.3.0-rc.4 unicorn-hydrafication (2014-10-01)
Bug Fixes
- $compile:
- input:
- ngModel: do not parse undefined viewValue when validating (92f05e5a, #9106, #9260)
- ngView: use animation promises ensure that only one leave animation occurs at a time (3624e380, #9355, #7606, #9374)
- select: make ctrl.hasOption method consistent (2bcd02dc, #8761)
Features
- $compile: optionally get controllers from ancestors only (07e3abc7, #4518, #4540, #8240, #8511)
- Scope: allow the parent of a new scope to be specified on creation (6417a3e9)
Performance Improvements
- $rootScope: moving internal queues out of the Scope instances (b1192518, #9071)
- benchmark: add ngBindOnce benchmarks to largetable-bp (2c8b4648)
- ngForm,ngModel: move initial addClass to the compile phase (b1ee5386, #8268)
Breaking Changes
- $compile: due to fb0c77f0,
$transclude
functions no longer attach $destroy
event handlers to the
transcluded content, and so the associated transclude scope will not automatically
be destroyed if you remove a transcluded element from the DOM using direct DOM
manipulation such as the jquery remove()
method.
If you want to explicitly remove DOM elements inside your directive that have been compiled, and so potentially contain child (and transcluded) scopes, then it is your responsibility to get hold of the scope and destroy it at the same time.
The suggested approach is to create a new child scope of your own around any DOM elements that you wish to manipulate in this way and destroy those scopes if you remove their contents - any child scopes will then be destroyed and cleaned up automatically.
Note that all the built-in directives that manipulate the DOM (ngIf, ngRepeat, ngSwitch, etc) already follow this best practice, so if you only use these for manipulating the DOM then you do not have to worry about this change.
Closes #9095 Closes #9281
-
$parse: due to 5572b40b,
-
$scope['this'] no longer exits on the $scope object
-
$parse-ed expressions no longer allow chaining 'this' such as this['this'] or $parent['this']
-
'this' in $parse-ed expressions can no longer be overriden, if a variable named 'this' is put on the scope it must be accessed using this['this']
Closes #9105
- input: due to 1eda1836,
(Note: this change landed in 1.3.0-rc.3, but was not considered a breaking change at the time).
For text based inputs (text, email, url), the $viewValue
will now always be converted to a string,
regardless of what type the value is on the model.
To migrate, any code or expressions that expect the $viewValue
to be anything other than string
should be updated to expect a string.
- input: due to a0bfdd0d60882125f614a91c321f12f730735e7b (see #8949),
Similar to input[number]
Angular will now throw if the model value
for a input[date]
is not a Date
object. Previously, Angular only
showed an empty string instead.
Angular does not set validation errors on the <input>
in this case
as those errors are shown to the user, but the erroneous state was
caused by incorrect application logic and not by the user.
1.2.26 captivating-disinterest (2014-10-01)
Bug Fixes
1.3.0-rc.3 aggressive-pacification (2014-09-23)
Bug Fixes
Features
- $location: add ability to opt-out of
<base>
tag requirement in html5Mode (dc3de7fb, #8934) - formController: add $setUntouched to propagate untouched state (fd899755, #9050)
- input: support dynamic element validation (729c238e, #4791, #1404)
- ngAria: add an ngAria module to make a11y easier (d1434c99, #5486)
Performance Improvements
- map: use Array.prototype.map (a591e8b8)
Breaking Changes
-
$location: due to dc3de7fb, The $location.html5Mode API has changed to allow enabling html5Mode by passing an object (as well as still supporting passing a boolean). Symmetrically, the method now returns an object instead of a boolean value.
To migrate, follow the code example below:
Before:
var mode = $locationProvider.html5Mode();
After:
var mode = $locationProvider.html5Mode().enabled;
Fixes #8934
1.2.25 hypnotic-gesticulation (2014-09-16)
Bug Fixes
- i18n: fix typo at i18n generation code (1b6d74cc)
- ngLocale: Regenerate Locale Files (06c76694)
- select: update option labels when model changes (d89d59f4, #9025)
1.3.0-rc.2 tactile-perception (2014-09-16)
Bug Fixes
- $compile: update
'@'
-bindings in controller whenbindToController
istrue
(e7ac08a0, #9052, #9077) - $parse: ensure CSP assignable expressions have
assign()
(d13b4bd1, #9048) - i18n: fix typo at i18n generation code (eb4afd45)
- input: always pass in the model value to
ctrl.$isEmpty
(3e51b84b, #5164, #9017) - jqLite: fix
event.stopImmediatePropagation()
so it works as expected (30354c58, #4833) - ngLocale: Regenerate Locale Files (6a96a820, #8931, #8583, #7799)
- ngModel:
- ngResource: make badcfg error message more helpful (a3962f0d, #9005, #9010)
- select: update option labels when model changes (46274102, #9025)
Features
- limitTo: support numeric input to limitTo (1c8a7459, #8926)
- ngInclude: add template url parameter to events (fd2d6c02, #8453, #8454)
Performance Improvements
- $compile: move
$$isolateBinding
creation to directive factory instead of on each link (56f09f0b) - $parse:
Breaking Changes
- $parse: due to fca6be71, all filters are assumed to be stateless functions
Previously it was just a good practice to make all filters stateless. Now it's a requirement in order for the model change-observation to pick up all changes.
If an existing filter is statefull, it can be flagged as such but keep in
mind that this will result in a significant performance-penalty (or rather
lost opportunity to benefit from a major perf improvement) that will
affect the $digest
duration.
To flag a filter as stateful do the following:
myApp.filter('myFilter', function() {
function myFilter(input) { ... };
myFilter.$stateful = true;
return myFilter;
});
1.3.0-rc.1 backyard-atomicity (2014-09-09)
Bug Fixes
- $location:
- $parse: disallow passing Function to Array.sort (bd8ad0fb)
- input: check
scope.$$phase
only on$rootScope
(bf59d727) - ngAnimate: support removing classes from SVG elements when using jQuery (b3b67213, #8872, #8893)
- ngEventDirs: check
scope.$$phase
only on$rootScope
(203ea10f, #8891) - ngForm: don't clear validity of whole form when removing control (953ee22f, #8863)
- ngInclude: correctly add svg-namespaced template content (6639ca9d, #7538, #8981, #8997)
- ngModel:
- update model value with async validators correctly (64c3b745)
- render immediately also with async validators (f94d5515)
- properly parse min/max date values as strings for date inputs (088545c1, #6755)
- revalidate the model when min/max expression values change for date inputs (b3502835, #6755)
- consider ngMin/ngMax values when validating number input types (25541c1f)
- revalidate the model when min/max expression values change for number inputs (7b273a2c, #2404)
- ngModelOptions: do not trigger digest on
setViewValue
if debouncing (e322cd9b, #8814, #8850, #8911) - ngRepeat: preserve original position of elements that are being animated away (ed637330, #8918, #8994)
- ngSwitch: ensure correct iterator is passed to async function (712299c2, #8833)
- numberFilter: format numbers that round to zero as nonnegative (ae952fbf, #8489)
- orderBy: allow arrayLike objects to be ordered (cbdaabfb, #8944)
Features
- angular.forEach: add the array/object as the 3rd param like the native array forEach (df9e60c8, #7902)
- ngModelOptions: add allowInvalid option (3c538c1d, #8290, #8313)
Performance Improvements
- $parse:
- extend: remove use of forEach to remove calls/closures/passing arguments (9bedeb33, #8898)
- jQuery: only trigger $destroy if a handler exists (f6aa1c55, #8859)
Breaking Changes
-
ngModelController,formController: due to 6046e14b,
-
ctrl.$error
no longer contains entries for validators that were successful. -
ctrl.$setValidity
now differentiates betweentrue
,false
,undefined
andnull
, instead of previously only truthy vs falsy.
Closes #8941- ngSwitch: due to 0f806d96,
Ever since 0df93fd, tagged in v1.0.0rc1, the ngSwitch directive has had an undocumented change
attribute, used for evaluating a scope expression when the switch value changes.
While it's unlikely, applications which may be using this feature should work around the removal by adding a custom directive which will perform the eval instead. Directive controllers are re-instantiated when being transcluded, so by putting the attribute on each item that you want to be notified of a change to, you can more or less emulate the old behaviour.
Example:
angular.module("switchChangeWorkaround", []).
directive("onSwitchChanged", function() {
return {
link: function($scope, $element, $attrs) {
$scope.$parent.$eval($attrs.onSwitchChanged);
}
};
});
<div ng-switch="switcher">
<div ng-switch-when="a" on-switch-changed="doSomethingInParentScope()"></div>
<div ng-switch-when="b" on-switch-changed="doSomethingInParentScope()"></div>
</div>
Closes #8858 Closes #8822
1.2.24 static-levitation (2014-09-09)
Bug Fixes
- $browser: detect changes to the browser url that happened in sync (2ece4d03, #6976)
- $compile:
- $location:
- $parse: disallow passing Function to Array.sort (b39e1d47)
- form: ensure concurrent animations use setClass (d7548fdf, #8166)
- input: check
scope.$$phase
only on$rootScope
(36e6de1d) - ngEventDirs:
- ngRepeat: improve errors for duplicate items (1812af58)
- numberFilter: format numbers that round to zero as nonnegative (7e02fa07, #8489)
- orderBy: allow arrayLike objects to be ordered (94b0f2d3, #8944)
Breaking Changes
- ngEventDirs: due to 54f0bc0f,
The blur
and focus
event fire synchronously, also during DOM operations
that remove elements. This lead to errors as the Angular model was not
in a consistent state. See this fiddle for a demo.
This change executes the expression of those events using
scope.$evalAsync
if an $apply
is in progress, otherwise
keeps the old behavior.
Fixes #4979 Fixes #5945 Closes #8803 Closes #6910 Closes #5402
1.3.0-RC.0 sonic-boltification (2014-08-29)
Bug Fixes
- $animate:
- $browser: detect changes to the browser url that happened in sync (3be00df4, #6976)
- $compile: use the correct namespace for transcluded svg elements (cb73a37c, #8808, #8816)
- $location: always resolve relative links in html5mode to
<base>
url (22948807, #8492, #8172) - $parse: properly handle dots at the end of identifiers (8ac90357, #4613, #4912, #8559)
- Angular: remove duplicate nodeName_ references (a4520a74)
- currencyFilter: pass through null and undefined values (c2aaddbe, #8605)
- docs: don't throw exception on the 404 page (550ba01b, #8518)
- input:
- ngBindHtml: throw error if interpolation is used in expression (cd21602d, #8824)
- ngEventDirs: execute
blur
andfocus
expression usingscope.$evalAsync
(719c747c, #4979, #5945, #8803, #6910, #5402) - ngModel:
- ngRepeat: improve errors for duplicate items (0604bb7b)
- ngSwitch: avoid removing DOM nodes twice within watch operation (c9b0bfec, #8662)
- numberFilter: pass through null and undefined values (2ae10f67, #8605, #8842)
Features
- core:
- add angular.reloadWithDebugInfo() (41c1b88)
- $animate:
- $compile:
- $compile/ngBind: allow disabling binding info (3660fd09)
- $http: implement mechanism for coalescing calls to $apply in $http (ea6fc6e6, #8736, #7634, #5297)
- $rootScope: implement $applyAsync to support combining calls to $apply into a single digest. (e94d454b)
- $templateRequest: introduce the $templateRequest service (a70e2833)
- filter: allow to define the timezone for formatting dates (4739b1d9)
- filterFilter: pass index to function predicate (46343c60, #654)
- input: allow to define the timezone for parsing dates (cc6fc199, #8447)
- minErr: allow specifying ErrorConstructor in minErr constructor (a6bd4bc8)
- ngModel: provide validation API functions for sync and async validations (2ae4f40b)
- ngRoute: alias string as redirectTo property in .otherwise() (3b5d75c0, #7794)
- testability: add $$testability service (85880a64)
Performance Improvements
- $compile:
- nodeName_: simplify the code and reduce the number of DOM calls (5a1a0c96)
- select: execute render after $digest cycle (6f7018d5, #8825)
Breaking Changes
- $location: due to 22948807
since 1.2.0 and 1.3.0-beta.1
Angular now requires a <base>
tag when html5 mode of $location
is enabled. Reasoning:
Using html5 mode without a <base href="...">
tag makes relative links for images, links, ...
relative to the current url if the browser supports
the history API. However, if the browser does not support the history API Angular falls back to using the #
,
and then all those relative links would be broken.
The <base>
tag is also needed when a deep url is loaded from the server, e.g. http://server/some/page/url
.
In that case, Angular needs to decide which part of the url is the base of the application, and which part
is path inside of the application.
To summarize: Now all relative links are always relative to the <base>
tag.
Exception (also a breaking change):
Link tags whose href
attribute starts with a #
will only change the hash of the url, but nothing else
(e.g. <a href="#someAnchor">
). This is to make it easy to scroll to anchors inside a document.
Related to #6162 Closes #8492
since 1.2.17 and 1.3.0-beta.10
In html5 mode without a <base>
tag on older browser that don't support the history API
relative paths were adding up. E.g. clicking on <a href="page1">
and then on <a href="page2">
would produce $location.path()==='/page1/page2'
. The code that introduced this behavior was removed
and Angular now also requires a <base>
tag to be present when using html5 mode.
Closes #8172, #8233
- ngInclude, ngMessage, ngView and directives that load templates: due to a70e2833
Angular will now throw a $compile minErr each a template fails to download for ngView, directives and ngMessage template requests. This changes the former behavior of silently ignoring failed HTTP requests--or when the template itself is empty. Please ensure that all directive, ngView and ngMessage code now properly addresses this scenario. NgInclude is uneffected from this change.
- $animate: due to 23da6140
If any stagger code consisted of having BOTH transition staggers and delay staggers together then that will not work the same way. Angular will now instead choose the highest stagger delay value and set the timeout to wait for that before applying the active CSS class.
- $animate: due to bf0f5502
Both the API for the cancallation method and the done callback for $animate animations is different. Instead of using a callback function for each of the $animate animation methods, a promise is used instead.
//before
$animate.enter(element, container, null, callbackFn);
//after
$animate.enter(element, container).then(callbackFn);
The animation can now be cancelled via $animate.cancel(promise)
.
//before
var cancelFn = $animate.enter(element, container);
cancelFn(); //cancels the animation
//after
var promise = $animate.enter(element, container);
$animate.cancel(promise); //cancels the animation
keep in mind that you will still need to run $scope.$apply inside of the then
callback
to trigger a digest.
- $animate: due to 2f4437b3
$animate.addClass, $animate.removeClass and $animate.setClass will no longer start the animation right after being called in the directive code. The animation will only commence once a digest has passed. This means that all animation-related testing code requires an extra digest to kick off the animation.
//before this fix
$animate.addClass(element, 'super');
expect(element).toHaveClass('super');
//now
$animate.addClass(element, 'super');
$rootScope.$digest();
expect(element).toHaveClass('super');
$animate will also tally the amount of times classes are added and removed and only animate the left over classes once the digest kicks in. This means that for any directive code that adds and removes the same CSS class on the same element then this may result in no animation being triggered at all.
$animate.addClass(element, 'klass');
$animate.removeClass(element, 'klass');
$rootScope.$digest();
//nothing happens...
- $compile/ngBind: due to 3660fd09,
The value of $binding
data property on an element is always an array now
and the expressions do not include the curly braces {{ ... }}
.
- currencyFilter: due to c2aaddbe, previously the currency filter would convert null and undefined values into empty string, after this change these values will be passed through.
Only cases when the currency filter is chained with another filter that doesn't expect null/undefined will be affected. This should be very rare.
This change will not change the visual output of the filter because the interpolation will convert the null/undefined to an empty string.
Closes #8605
- numberFilter: due to 2ae10f67, previously the number filter would convert null and undefined values into empty string, after this change these values will be passed through.
Only cases when the number filter is chained with another filter that doesn't expect null/undefined will be affected. This should be very rare.
This change will not change the visual output of the filter because the interpolation will convert the null/undefined to an empty string.
Closes #8605 Closes #8842
- input:
- due to 77ce5b89,
NgModel.viewValue will always be used when rendering validations for minlength
and maxlength
.
Closes #7967 Closes #8811
- input:
- due to 29f0b568,
According to the HTML5 spec input[time]
should create dates
based on the year 1970 (used to be based on the year 1900).
Related to #8447.
- ngModel: due to db044c40
Any parser code from before that returned an undefined
value
(or nothing at all) will now cause a parser failure. When this occurs
none of the validators present in $validators
will run until the parser
error is gone. The error will be stored on ngModel.$error
.
- ngEventDirs: due to 719c747c,
The blur
and focus
event fire synchronously, also during DOM operations
that remove elements. This lead to errors as the Angular model was not
in a consistent state. See this fiddle for a demo.
This change executes the expression of those events using
scope.$evalAsync
if an $apply
is in progress, otherwise
keeps the old behavior.
Fixes #4979 Fixes #5945 Closes #8803 Closes #6910 Closes #5402
- $compile: due to 5f3f25a1,
The returned value from directive controller constructors are now ignored, and only the constructed instance itself will be attached to the node's expando. This change is necessary in order to ensure that it's possible to bind properties to the controller's instance before the actual constructor is invoked, as a convenience to developers.
In the past, the following would have worked:
angular.module("myApp", []).
directive("myDirective", function() {
return {
controller: function($scope) {
return {
doAThing: function() { $scope.thingDone = true; },
undoAThing: function() { $scope.thingDone = false; }
};
},
link: function(scope, element, attrs, ctrl) {
ctrl.doAThing();
}
};
});
However now, the reference to doAThing()
will be undefined, because the return value of the controller's constructor is ignored. In order to work around this, one can opt for several strategies, including the use of _.extend()
or merge()
like routines, like so:
angular.module("myApp", []).
directive("myDirective", function() {
return {
controller: function($scope) {
_.extend(this, {
doAThing: function() { $scope.thingDone = true; },
undoAThing: function() { $scope.thingDone = false; }
});
},
link: function(scope, element, attrs, ctrl) {
ctrl.doAThing();
}
};
});
1.2.23 superficial-malady (2014-08-22)
Bug Fixes
- $location:
- $sanitize: sanitize javascript urls with comments (4f387050, #8274)
- Angular: make Date comparison in equals() NaN-aware (98f60372, #8650, #8715)
- copy: clear array destinations correctly for non-array sources (888b0f54, #8610, #8702)
- input:
- linky: handle quotes around email addresses (effc98fd, #8520)
- minErr: encode btstrpd error input to strip angle brackets (aaf9c5e5, #8683)
- ngHref: remove attribute when empty value instead of ignoring (ed56872b, #2755)
Breaking Changes
- input: due to ebece0bc,
Previously, input[type=password]
would trim values by default, and would require an explicit ng-trim="false"
to disable the trimming behaviour. After this CL, ng-trim
no longer affects input[type=password]
, and will
never trim the password value.
Closes #8250 Closes #8230
1.3.0-beta.19 rafter-ascension (2014-08-22)
Bug Fixes
- $compile:
- $location:
- $parse: remove unused variable declaration in generated getters (6acea115)
- $sanitize: sanitize javascript urls with comments (b7e82a33, #8274)
- $watchGroup: call listener once when the
watchExpressions
array is empty (bf0e8373) - Angular: make Date comparison in
equals()
NaN
-aware (693e846a, #8650, #8715) - Scope: don't clear the phase when an exception is thrown from asyncQueue or watch (bf1a57ad)
- copy: clear array destinations correctly for non-array sources (a603e202, #8610, #8702)
- forEach: match behaviour of Array.prototype.forEach (ignore missing properties) (36230194, #8510, #8522, #8525)
- input:
- jQuery: cooperate with other libraries monkey-patching jQuery.cleanData (b9389b26, #8471)
- jqLite:
- linky: handle quotes around email addresses (a9d22712, #8520)
- minErr: encode btstrpd error input to strip angle brackets (0872388a, #8683)
- ngRepeat:
Features
- $compile:
- benchpress: configure benchpress grunt task (6bdaa4bc)
- jqLite: implement the
detach
method (1a05daf5, #5461) - ngRoute: add method for changing url params (77a1acc7)
Performance Improvements
- $compile:
- don't register $destroy callbacks on element-transcluded nodes (b5f7970b)
- refactor publicLinkFn to simplify the code and use 'for in' loop (645625cf)
- clone the nodeList during linking only if necessary (3e0a2e1f)
- delay object initialization in nodeLinkFn (31ed0af7)
- optimize nodeLinkFn (35134a0e)
- optimize publicLinkFn (274e9c4d)
- $interpolate: do not keep empty separators (94b5c9f0)
- $parse:
- don't bind filters to a context (8863b9d0)
- optimize filter implementation (ece6ef47)
- speed up fn invocation for no args case (a17578ad)
- speed up fn invocation by optimizing arg collection (fecfc5b0)
- use no-proto maps as caches and avoid hasOwnProperty checks (d302ea0c)
- trim expression only if string (a1341223)
- $rootScope: do not use
Function::call
when not needed (7eae29e5) - Scope:
- benchpress: add benchpress node module and port over large table test (1229334f)
- isObject: use strict comparison (d208ba25)
- jqLite:
- simplify jqLiteDealoc (f8f7a1df)
- optimize event handler (d05f27e2)
- only take
str.split()
path when needed (187b1b8e, #8648) - optimize
off()
(abb17cce) - refactor jqLiteExpandoStore to minimize access to expensive element.ng339 expando property (1e8698b3)
- microoptimization in chaining fn (fafbd494)
- don't use String#split in on() unless we need it (bda673f8)
- don't check isString many times in constructor (443b521e)
- optimize jqLiteAcceptsData method (b493c62f)
- optimize
append()
andafter()
(8d933bf9) - don't register DOM listener for $destroy event (6251751a)
- optimize event listener registration (566f1015)
- improve createEventHandler method by switching from forEach to for loop (e9cd6dc0)
- don't use
forEach
inoff()
(960a8410) - don't recreate the Node.contains polyfill (d1536e7c)
- speed up shallowCopy and special case Attributes cloning (54fa16e4)
- ngBind: bypass jquery/jqlite when setting text (0a738ce1)
- ngRepeat:
- simplify code and remove duplicate array.length access (08eb0558)
- optimize marking of nodes that are being removed via an animation (36e35b2c)
- use no-proto objects for blockMaps (13d113c5)
- move work to compile fn (bdd853cb)
- move updateScope fn to factory and reuse it for all repeaters (e58d65a5)
- clone boundary comment nodes (fbd48845)
Breaking Changes
- $compile:
- due to 09de7b5d,
Now, ng-attr-*
will never add the attribute to the DOM if any of the interpolated expressions
evaluate to undefined
.
To work around this, initialize values which are intended to be the empty string with the empty string:
For example, given the following markup:
<div ng-attr-style="border-radius: {{value}}{{units}}"></div>
If $scope.value
is 4
, and $scope.units
is undefined
, the resulting markup is unchanged:
<div ng-attr-style="border-radius: {{value}}{{units}}"></div>
However, if $scope.units is ""
, then the resulting markup is updated:
<div ng-attr-style="border-radius: {{value}}{{units}}" style="border-radius: 4"></div>
Closes #8376 Closes #8399
- due to 0d608d04, element-transcluded directives now have an extra comment automatically appended to their cloned DOM
This comment is usually needed to keep track the end boundary in the event child directives modify the root node(s). If not used for this purpose it can be safely ignored.
- due to 75c4cbf8,
directive.type
was renamed todirective.templateNamespace
This change is breaking only within 1.3.0-beta releases: directive.type
was renamed to directive.templateNamespace
The property name type
was too general.
- $parse: due to 8863b9d0,
this
in filters is now undefined and no longer the scope
It's a bad practice for filters to have hidden dependencies, so pulling stuff from scope directly is not a good idea. Scope being the filter context was never documented as public API, so we don't expect that any significant code depends on this behavior.
If an existing filter has a dependency on the scope instance, the scope reference can be passed into the filter as a filter argument (this is highly discouraged for new code):
Before: {{ user.name | customFilter }}
After: {{ user.name | customFilter:this }}
- Scope: due to 0554c1aa,
deregisterNotifier
callback for$watch
is no longer available
This API was available only in the last few 1.3 beta versions and is not very useful for applications, so we don't expect that anyone will be affected by this change.
- input: due to a7fb357f,
by default, do not trim
input[type=password]
values.
Previously, input[type=password]
would trim values by default, and would require an explicit ng-trim="false"
to disable the trimming behaviour. After this change, ng-trim
no longer affects input[type=password]
, and will
never trim the password value.
Closes #8250 Closes #8230
1.3.0-beta.18 spontaneous-combustion (2014-08-12)
Bug Fixes
- $compile: make '='-bindings NaN-aware (5038bf79, #8553, #8554)
- $location: add semicolon to whitelist of delimiters to unencode (36258033, #5019)
- $parse:
- Scope: add deregisterNotifier to oneTimeLiteralWatch signature (a001a417)
- jqLite:
- ngSanitize: ensure
html
is a string in htmlParser() (34781f18, #8417, #8416) - select:
Features
- $parse: allow for assignments in ternary operator branches (2d678f1d, #8512, #8484)
- form: Add new $submitted state to forms (108a69be, #8056)
- http: allow caching for JSONP requests (3607c982, #1947, #8356)
- jQuery: upgrade to jQuery to 2.1.1 (9e7cb3c3)
- ngMock: allow override of when/expect definitions (477626d8, #5766, #8352)
Performance Improvements
- $q: move Deferred and Promise methods to prototypes (23bc92b1, #8300)
- input: prevent additional $digest when input is already touched (dd2a803f, #8450)
Breaking Changes
- jQuery: due to 9e7cb3c3, Angular no longer supports jQuery versions below 2.1.1.
- $q: due to 23bc92b1,
Promises methods are no longer enumerated when using for-loops with
hasOwnProperty
check. E.g.angular.extends
1.2.22 finicky-pleasure (2014-08-12)
Bug Fixes
- $compile: make '='-bindings NaN-aware (0b0acb03, #8553, #8554)
- $parse: correctly assign expressions who's path is undefined and that use brackets notation (60366c8d, #8039)
- jqLite: allow
triggerHandler()
to accept custom event (d262378b, #8469, #8505) - ngSanitize: ensure
html
is a string in htmlParser() (9ee07551, #8417, #8416) - select:
Features
- $parse: allow for assignments in ternary operator branches (93b0c2d8, #8512, #8484)
- http: allow caching for JSONP requests (eab5731a, #1947, #8356)
1.3.0-beta.17 turing-autocompletion (2014-07-25)
Bug Fixes
- angular.copy: clone regexp flags correctly (86340a59, #5781, #8337)
- docs: change plnkr form to open in same window (925b2080)
- jqLite: triggerHandler support unbind self (8a27abae, #5984)
- ngHref: remove attribute when empty value instead of ignoring (469ea338, #2755)
Features
- $compile: change directive's restrict setting to default to EA (element/attribute) (11f5aeee, #8321)
- $q: add streamlined ES6-style interface for using $q (f3a763fd, #8311, #6427)
- ngRepeat: provide support for aliasing filtered repeater results as a scope member (e0adb9c4, #5919, #8046, #8282)
Performance Improvements
- $parse: don't use reflective calls in generated functions (c54228fb)
Breaking Changes
- $compile: due to 11f5aeee,
directives now match elements by default unless specific restriction rules are set via
restrict
property.
This means that if a directive 'myFoo' previously didn't specify matching restrictrion, it will now match both the attribute and element form.
Before:
<div my-foo></div>
<---- my-foo attribute matched the directive
<my-foo></my-foo>
<---- no match
After:
<div my-foo></div>
<---- my-foo attribute matched the directive
<my-foo></my-foo>
<---- my-foo element matched the directive
It is not expected that this will be a problem in practice because of widespread use of prefixes that make <my-foo>
like
elements unlikely.
Closes #8321
1.2.21 wizard-props (2014-07-25)
Bug Fixes
- $http: fix double-quoted date issue when encoding params (2f960f15, #8150, #6128, #8154)
- $location: handle plus character in query strings (60af504c, #3042)
- $rootScope: $watchCollection should handle NaN in objects (bf13d268, #7930)
- angular.copy: clone regexp flags correctly (e25ed0d4, #5781, #8337)
- csp: fix autodetection of CSP + better docs (0e5d3190, #8162, #8191)
- docs: change plnkr form to open in same window (5d11e020)
- jqLite: triggerHandler support unbind self (209e6000, #5984)
- ngHref: remove attribute when empty value instead of ignoring (948c86c6, #2755)
- ngRoute: remove unnecessary call to decodeURIComponent (1b779028, #6326, #6327)
- ngSanitize:
- orderBy: correctly order by date values (f1b28847, #6675, #6746)
- select: force visual update in IE (c0afbfac, #7692, #8158)
Performance Improvements
- $compile: only create jqLite object when necessary (71eb1901)
- $parse: don't use reflective calls in generated functions (cbdf0c2a)
- forEach: use native for loop instead of forEach for Arrays (492b0cdf)
- jqLite: expose the low-level jqLite.data/removeData calls (3c46c943)
- ngBindHtml: move addClass to the compile phase (8eede099, #8261)
1.3.0-beta.16 pizza-transubstantiation (2014-07-18)
Bug Fixes
- $cookie: use
decodeURIComponent
instead of unescape for cookie reading (1c9ab40d, #8125) - $http: fix double-quoted date issue when encoding params (9dce42b3, #8150, #6128, #8154)
- $location: handle plus character in query strings (3f4ee151, #3042)
- $rootScope:
- csp: fix autodetection of CSP + better docs (0113f225, #8162, #8191)
- ngList: use custom separators for re-joining list items (c6c9d26e, #4008, #2561, #4344)
- ngRoute: remove unnecessary call to
decodeURIComponent
(528f56a6, #6326, #6327) - ngSanitize: follow HTML parser rules for start tags / allow < in text content (f6681d41, #8212, #8193)
- ngSwitch:
- orderBy: correctly order by date values (92bceb5c, #6675, #6746)
- select: force visual update in IE (d7f73022, #7692, #8158)
Features
- $compile: explicitly request multi-element directive behaviour (e8066c4b, #5372, #6574, #5370, #8044, #7336)
- ngList: use ngTrim to manage whitespace handling when splitting (8d18d20e)
- ngTransclude: allow ngTransclude to be used as an element (3dafcba9, #8141)
Performance Improvements
- $compile: only create jqLite object when necessary (a160f76f)
- bindOnce more performant interpolation and lazy one-time binding (86d55c1d)
- jqLite: expose the low-level jqLite.data/removeData calls (e4ba8943)
- ngBindHtml: move addClass to the compile phase (903e7352, #8261)
Breaking Changes
- $compile: due to e8066c4b, Directives which previously depended on the implicit grouping between directive-start and directive-end attributes must be refactored in order to see this same behaviour.
Before:
<div data-fancy-directive-start>{{start}}</div>
<p>Grouped content</p>
<div data-fancy-directive-end>{{end}}</div>
.directive('fancyDirective', function() {
return {
link: angular.noop
};
})
After:
<div data-fancy-directive-start>{{start}}</div>
<p>Grouped content</p>
<div data-fancy-directive-end>{{end}}</div>
.directive('fancyDirective', function() {
return {
multiElement: true, // Explicitly mark as a multi-element directive.
link: angular.noop
};
})
Closes #5372 Closes #6574 Closes #5370 Closes #8044 Closes #7336
- $rootScope: due to 02c0ed27,
Previously, it was possible for an action passed to $watch to be a string, interpreted as an angular expresison. This is no longer supported. The action now has to be a function. Passing an action to $watch is still optional.
Before:
$scope.$watch('state', ' name="" ');
After:
$scope.$watch('state', function () {
$scope.name = "";
});
Closes #8190
- bootstrap: due to 666a3835,
If using any of the mechanisms specified above, then migrate by
specifying the attribute ng-app
to the root element. E.g.
<div ng-app="module">...</div>
Closes #8147
- ngList: due to c6c9d26e,
The ngList
directive no longer supports splitting the view value
via a regular expression. We need to be able to re-join list items back
together and doing this when you can split with regular expressions can
lead to inconsistent behaviour and would be much more complex to support.
If your application relies upon ngList splitting with a regular expression then you should either try to convert the separator to a simple string or you can implement your own version of this directive for you application.
Closes #4008 Closes #2561 Closes #4344
- ngSwitch: due to 4f32e3ee,
** Directive Priority Changed ** - this commit changes the priority
of ngSwitchWhen
and ngSwitchDefault
from 800
to 1200
. This makes their
priority higher than ngRepeat
, which allows items to be repeated on
the switch case element reliably.
In general your directives should have a lower priority than these directives if you want them to exist inside the case elements. If you relied on the priority of these directives then you should check that your code still operates correctly.
Closes #8235
1.3.0-beta.15 unbelievable-advancement (2014-07-11)
Bug Fixes
- $animate:
- $http:
- $location: remove query args when passed in object (2c7d0857, #6565)
- input:
- jqLite:
- ngModel: test & update correct model when running $validate (f3cb2741, #7836, #7837)
- parseKeyValue: ignore properties in prototype chain (cb42766a, #8070, #8068)
- select: auto-select new option that is marked as selected (b8ae73e1, #6828)
Features
- $animate: allow directives to cancel animation events (ca752790, #7722)
- $controller: disable using global controller constructors (3f2232b5)
- FormController: add
$rollbackViewValue
to rollback all controls (85b77314, #7595) - input: support constant expressions for ngTrueValue/ngFalseValue (c90cefe1, #8041, #5346, #1199)
- ngAnimate: conditionally allow child animations to run in parallel with parent animations (8252b8be, #7946)
- ngModel: bind to getters/setters (b9fcf017, #768)
Performance Improvements
Breaking Changes
- $controller: due to 3f2232b5,
$controller
will no longer look for controllers on window
.
The old behavior of looking on window
for controllers was originally intended
for use in examples, demos, and toy apps. We found that allowing global controller
functions encouraged poor practices, so we resolved to disable this behavior by
default.
To migrate, register your controllers with modules rather than exposing them as globals:
Before:
function MyController() {
// ...
}
After:
angular.module('myApp', []).controller('MyController', [function() {
// ...
}]);
Although it's not recommended, you can re-enable the old behavior like this:
angular.module('myModule').config(['$controllerProvider', function($controllerProvider) {
// this option might be handy for migrating old apps, but please don't use it
// in new ones!
$controllerProvider.allowGlobals();
}]);
- input: due to c90cefe1,
Previously, these attributes would always be treated as strings. However, they are now parsed as expressions, and will throw if an expression is non-constant.
To convert non-constant strings into constant expressions, simply wrap them in an extra pair of quotes, like so:
<input type="checkbox" ng-model="..." ng-true-value="'truthyValue'">
Closes #8041 Closes #5346 Closes #1199
1.2.20 accidental-beautification (2014-07-11)
Bug Fixes
- $http:
- $location: remove query args when passed in object (a26acb64, #6565)
- input:
- parseKeyValue: ignore properties in prototype chain (873acf8f, #8070, #8068)
Features
- ngAnimate: conditionally allow child animations to run in parallel with parent animations (931789ec, #7946)
1.3.0-beta.14 harmonious-cacophonies (2014-06-30)
This release contains security fixes for $parse that prevent arbitrary code execution via Angular expressions under some very specific conditions. The only applications affected by these vulnerabilities are those that match all of the following conditions:
- application mixes server-side and client-side templating
- the server-side templating contains XSS vulnerabilities
- the vulnerabilities in the server-side templating are being guarded by server-side XSS filters or on the client-side via CSP
- the server-side XSS vulnerabilities can be used to augment the client-side template processed by Angular
Applications not meeting all of the conditions are not vulnerable.
This fix is in both 1.3.0-beta.14 and 1.2.19 release.
The Angular team would like to thank Jann Horn for reporting these vulnerabilities via [security@angularjs.org].
Bug Fixes
- $compile: bind ng-attr-* even if unbound attribute follows ng-attr-* (8b0258d8, #7739)
- $http:
- $injector: check if a fn is an array explicitly (b1a6baac, #7904, #2653)
- $interval: when canceling, use clearInterval from $window instead of global scope. (a4904c0f)
- $parse:
- prevent invocation of Function's bind, call and apply (77ada4c8)
- forbid proto properties in angular expressions (6081f207)
- forbid {define,lookup}{Getter,Setter} properties (48fa3aad)
- forbid referencing Object in angular expressions (528be29d)
- handle constants as one-time binding expressions (d9763f1b, #7970)
- $timeout/$interval: if invokeApply is false, do not use evalAsync (19b6b343, #7999, #7103)
- Angular: nodeName should always be lowercase (dafb8a3c, #3987)
- Angular.copy: preserve prototype chain when copying objects (b59b04f9, #5063, #3767, #4996)
- core: drop the toBoolean function (bdfc9c02, #3969, #4277, #7960)
- injector: allow multiple loading of function modules (2f0a4488, #7255)
- input:
- jqLite:
- numberFilter: correctly round fractions despite floating-point arithmetics issues in JS (189cd064, #7870, #7878)
- testabilityPatch: fix invocations of angular.mock.dump (e8e07502)
Features
Performance Improvements
- forEach: use native for loop instead of forEach for Arrays (36625de0)
Breaking Changes
- $parse:
- due to 77ada4c8,
You can no longer invoke .bind, .call or .apply on a function in angular expressions. This is to disallow changing the behaviour of existing functions in an unforseen fashion.
- due to 6081f207,
The (deprecated) proto propery does not work inside angular expressions anymore.
- due to 48fa3aad,
This prevents the use of {define,lookup}{Getter,Setter} inside angular expressions. If you really need them for some reason, please wrap/bind them to make them less dangerous, then make them available through the scope object.
- due to 528be29d,
This prevents the use of Object
inside angular expressions.
If you need Object.keys, make it accessible in the scope.
- Angular.copy: due to b59b04f9,
This changes angular.copy
so that it applies the prototype of the original
object to the copied object. Previously, angular.copy
would copy properties
of the original object's prototype chain directly onto the copied object.
This means that if you iterate over only the copied object's hasOwnProperty
properties, it will no longer contain the properties from the prototype.
This is actually much more reasonable behaviour and it is unlikely that
applications are actually relying on this.
If this behaviour is relied upon, in an app, then one should simply iterate
over all the properties on the object (and its inherited properties) and
not filter them with hasOwnProperty
.
Be aware that this change also uses a feature that is not compatible with
IE8. If you need this to work on IE8 then you would need to provide a polyfill
for Object.create
and Object.getPrototypeOf
.
- core: due to bdfc9c02, values 'f', '0', 'false', 'no', 'n', '[]' are no longer treated as falsy. Only JavaScript falsy values are now treated as falsy by the expression parser; there are six of them: false, null, undefined, NaN, 0 and "".
Closes #3969 Closes #4277 Closes #7960
- $timeout/$interval:
- due to 19b6b343
Previously, even if invokeApply was set to false, a $rootScope digest would occur during promise
resolution. This is no longer the case, as promises returned from $timeout and $interval will no
longer trigger $evalAsync (which in turn causes a $digest) if invokeApply
is false.
Workarounds include manually triggering $scope.$apply(), or returning $q.defer().promise from a promise callback, and resolving or rejecting it when appropriate.
var interval = $interval(function() {
if (someRequirementFulfilled) {
$interval.cancel(interval);
$scope.$apply();
}
}, 100, 0, false);
or:
var interval = $interval(function (idx) {
// make the magic happen
}, 1000, 10, false);
interval.then(function(idx) {
var deferred = $q.defer();
// do the asynchronous magic --- $evalAsync will cause a digest and cause
// bindings to update.
return deferred.promise;
});
1.2.19 precognitive-flashbacks (2014-06-30)
Bug Fixes
- $compile: bind ng-attr-* even if unbound attribute follows ng-attr-* (ed59370d)
- $http: should not read statusText on IE<10 when request is aborted (0c80df21)
- $injector: check if a fn is an array explicitly (67c11b9a, #7904, #2653)
- $interval: when canceling, use clearInterval from $window instead of global scope. (f780ccfa)
- $parse:
- make the window check in ensureSafeObject IE8 friendly (ba62e975)
- prevent invocation of Function's bind, call and apply (07fa87a8)
- forbid proto properties in angular expressions (cb713e60)
- forbid {define,lookup}{Getter,Setter} properties (89ca8597)
- forbid referencing Object in angular expressions (bc6fb7cc)
- injector: allow multiple loading of function modules (d71f16e7, #7255)
- input:
- jqLite: change expando property to a more unique name (74e1cc68)
- numberFilter: correctly round fractions despite floating-point arithmetics issues in JS (e5f454c8, #7870, #7878)
- testabilityPatch: fix invocations of angular.mock.dump (5e944a1c)
Performance Improvements
- jqLite: don't use reflection to access expandoId (a4faa5cd)
Breaking Changes
- $parse:
- due to 07fa87a8,
You can no longer invoke .bind, .call or .apply on a function in angular expressions. This is to disallow changing the behaviour of existing functions in an unforseen fashion.
- due to cb713e60,
The (deprecated) proto propery does not work inside angular expressions anymore.
- due to 89ca8597,
This prevents the use of {define,lookup}{Getter,Setter} inside angular expressions. If you really need them for some reason, please wrap/bind them to make them less dangerous, then make them available through the scope object.
- due to bc6fb7cc,
This prevents the use of Object
inside angular expressions.
If you need Object.keys, make it accessible in the scope.
1.3.0-beta.13 idiosyncratic-numerification (2014-06-16)
Bug Fixes
- jqLite: change expando property to a more unique name (20c3c9e2)
1.3.0-beta.12 ephemeral-acceleration (2014-06-13)
Bug Fixes
- $compile:
- $injector: report circularity in circular dependency error message (545d22b4, #7500)
- $parse: Handle one-time to
null
(600a41a7, #7743, #7787) - NgModel:
- ensure pattern and ngPattern use the same validator (1be9bb9d)
- make ngMinlength and ngMaxlength as standalone directives (26d91b65, #6750)
- make sure the ngMinlength and ngMaxlength validators use the $validators pipeline (5b8e7ecf, #6304)
- make sure the pattern validator uses the $validators pipeline (e63d4253)
- make sure the required validator uses the $validators pipeline (e53554a0, #5164)
- jqLite: data should store data only on Element and Document nodes (a196c8bc)
- ngResource: don't convert literal values into Resource objects when isArray is true (16dfcb61, #6314, #7741)
Features
- NgModel: introduce the $validators pipeline (a8c7cb81)
- attrs: trigger observers for specific ng-attributes (d9b90d7c, #7758)
- input: add $touched and $untouched states (adcc5a00)
- ngInclude: emit $includeContentError when HTTP request fails (e4419daf, #5803)
Performance Improvements
- $compile: move ng-binding class stamping for interpolation into compile phase (35358fdd)
- $http: move xsrf cookie check to after cache check in $http (dd1d189e, #7717)
- Scope: change Scope#id to be a simple number (8c6a8171)
- forEach: cache array length (55991e33)
- isArray: use native Array.isArray (751ebc17, #7735)
- isWindow optimize internal isWindow call (b68ac4cb)
- jqLite:
- ngBind: set the ng-binding class during compilation instead of linking (fd5f3896)
- shallowCopy: use Object.keys to improve performance (04468db4)
Breaking Changes
- $compile: due to 2cde927e,
Requesting isolate scope and any other scope on a single element is an error. Before this change, the compiler let two directives request a child scope and an isolate scope if the compiler applied them in the order of non-isolate scope directive followed by isolate scope directive.
Now the compiler will error regardless of the order.
If you find that your code is now throwing a $compile:multidir
error,
check that you do not have directives on the same element that are trying
to request both an isolate and a non-isolate scope and fix your code.
Closes #4402 Closes #4421
- NgModel: due to 1be9bb9d,
If an expression is used on ng-pattern (such as ng-pattern="exp"
) or on the
pattern attribute (something like on pattern="{{ exp }}"
) and the expression
itself evaluates to a string then the validator will not parse the string as a
literal regular expression object (a value like /abc/i
). Instead, the entire
string will be created as the regular expression to test against. This means
that any expression flags will not be placed on the RegExp object. To get around
this limitation, use a regular expression object as the value for the expression.
//before
$scope.exp = '/abc/i';
//after
$scope.exp = /abc/i;
- Scope: due to 8c6a8171, Scope#$id is now of time number rather than string. Since the id is primarily being used for debugging purposes this change should not affect anyone.
- forEach: due to 55991e33, forEach will iterate only over the initial number of items in the array. So if items are added to the array during the iteration, these won't be iterated over during the initial forEach call.
This change also makes our forEach behave more like Array#forEach.
- jqLite: due to a196c8bc, previously it was possible to set jqLite data on Text/Comment nodes, but now that is allowed only on Element and Document nodes just like in jQuery. We don't expect that app code actually depends on this accidental feature.
1.2.18 ear-extendability (2014-06-13)
Bug Fixes
- $compile:
- ensure transclude works at root of templateUrl (fd420c40, #7183, #7772)
- bound transclusion to correct scope (1382d4e8)
- don't pass transcludes to non-transclude templateUrl directives (b9ddef2a)
- don't pass transclude to template of non-transclude directive (eafba9e2)
- fix nested isolated transclude directives (bb931097, #1809, #7499)
- pass transcludeFn down to nested transclude directives (8df5f325, #7240, #7387)
- $injector: report circularity in circular dependency error message (14e797c1, #7500)
- ngResource: don't convert literal values into Resource objects when isArray is true (f0904cf1, #6314, #7741)
Performance Improvements
- $compile: move ng-binding class stamping for interpolation into compile phase (81b7e5ab)
- $http: move xsrf cookie check to after cache check in $http (8b86d363, #7717)
- isArray: use native Array.isArray (6c14fb1e)
- jqLite: cache collection length for all methods that work on a single element (6d418ef5)
- ngBind: set the ng-binding class during compilation instead of linking (1b189027)
1.3.0-beta.11 transclusion-deforestation (2014-06-06)
Bug Fixes
- $animate: remove the need to add
display:block !important
forngShow
/ngHide
(7c011e79, #3813) - $compile:
- bound transclusion to correct scope (56c60218)
- set the iteration state before linking (0c8a2cd2)
- don't pass transcludes to non-transclude templateUrl directives (2ee29c5d)
- don't pass transclude to template of non-transclude directive (19af0397)
- fix nested isolated transclude directives (d414b787, #1809, #7499)
- pass transcludeFn down to nested transclude directives (1fef5fe8, #7240, #7387)
- $parse: fix parsing error with leading space and one time bind (24c844df, #7640)
- angular.copy: support circular references in the value being copied (083f496d, #7618)
- angular.toJson: only strip properties beginning with
$$
, not$
(c054288c) - ngAnimate:
- ngClass: support multiple classes in key (7eaaca8e)
- ngIf: ensure that the correct (transcluded) scope is used (d71df9f8)
- ngLocale: fix i18n code-generation to support
get_vf_
,decimals_
, andget_wt_
(cbab51ca) - ngRepeat: ensure that the correct (transcluded) scope is used (b87e5fc0)
- ngShow: ensure that the display property is never set to
block
(1d90744f, #7707)
Features
- $resource: allow props beginning with
$
to be used on resources (d3c50c84)
Breaking Changes
- $compile: due to 2ee29c5d,
The isolated scope of a component directive no longer leaks into the template that contains the instance of the directive. This means that you can no longer access the isolated scope from attributes on the element where the isolated directive is defined.
See https://github.com/angular/angular.js/issues/10236 for an example.
-
$resource: due to d3c50c84,
If you expected
$resource
to strip these types of properties before, you will have to manually do this yourself now. -
angular.toJson: due to c054288c,
If you expected
toJson
to strip these types of properties before, you will have to manually do this yourself now.
1.2.17 - quantum disentanglement (2014-06-06)
Bug Fixes
- $animate:
- $compile:
- do not merge attrs that are the same for replace directives (b635903e, #7463)
- pass
transcludeFn
down to nested transclude directives (11385060, #7240, #7387) - set
$isolateScope
correctly for sync template directives (5319621a, #6942) - reference correct directive name in
ctreq
error (6bea0591, #7062, #7067) - fix regression which affected old jQuery releases (a97a172e)
- $httpBackend: don't error when JSONP callback is called with no parameter (a7ccb753, #7031)
- $location:
- angular.copy: support circular references in the value being copied (5c997209, #7618)
- grunt-utils: ensure special inline CSS works when
angular
is not a global (d4231171, #7176) - input:
- jqLite: use jQuery only if
jQuery.fn.on
is present (fafcd628) - limitTo: do not convert
Infinity
toNaN
(fcdac65a, #6771, #7118) - ngAnimate:
$animate
methods should accept native DOM elements (9227a5db) - ngClass:
- ngLocale: fix i18n code-generation to support
get_vf_
,decimals_
, andget_wt_
(96a31476) - ngSanitize: encode surrogate pair properly (3d0b49c0, #5088, #6911)
- ngSwitch: properly support case labels with different numbers of transclude fns (32aa4915)
- numberFilter: fix rounding error edge case (0388eed7, #7453, #7478)
Features
Performance Improvements
- $interpolate: optimize value stringification (9d4fa33e, #7501)
- scope: 10x. Share the child scope class. (9ab9bf6b)
1.3.0-beta.10 excessive-clarification (2014-05-23)
Bug Fixes
- $animate: retain inline styles for property-specific transitions (98b9d68e, #7503)
- $compile: do not merge attrs that are the same for replace directives (1ab6e908, #7463)
- $parse: remove deprecated promise unwrapping (fa6e411d)
- Scope: $broadcast and $emit should set event.currentScope to null (82f45aee, #7445, #7523)
- ngModel: do not dirty the input on $commitViewValue if nothing was changed (facd904a, #7457, #7495)
Features
- $interpolate: escaped interpolation expressions (e3f78c17, #5601, #7517)
- {{ bindings }}: lazy one-time binding support (cee429f0, #7486, #5408)
- ngMock: add support of mocha tdd interface (854bf5b7, #7489)
Performance Improvements
Breaking Changes
-
$compile: due to eec6394a, The
replace
flag for defining directives that replace the element that they are on will be removed in the next major angular version. This feature has difficult semantics (e.g. how attributes are merged) and leads to more problems compared to what it solves. Also, with Web Components it is normal to have custom elements in the DOM. -
$parse: due to fa6e411d, promise unwrapping has been removed. It has been deprecated since 1.2.0-rc.3. It can no longer be turned on. Two methods have been removed:
$parseProvider.unwrapPromises
$parseProvider.logPromiseWarnings
-
Scope: due to 82f45aee, #7445, #7523
$broadcast
and$emit
will now reset thecurrentScope
property of the event to null once the event finished propagating. If any code depends on asynchronously accessing theircurrentScope
property, it should be migrated to usetargetScope
instead. All of these cases should be considered programming bugs.
1.3.0-beta.9 release-naming (2014-05-16)
Bug Fixes
- $compile: pass
transcludeFn
down to nested transclude directives (4f03dc5a, #7240, #7387) - jqLite: use jQuery only if jQuery.fn.on present (e9bc51cb)
- ngClass: handle index changes when an item is unshifted (5fbd618c, #7256)
- ngMessages: annotate ngMessages controller for minification (0282ca97)
- numberFilter: fix rounding error edge case (81d427b5, #7453, #7478)
Features
- ngTouch: add optional
ngSwipeDisableMouse
attribute tongSwipe
directives to ignore mouse events. (5a568b4f, #6627, #6626)
Breaking Changes
- jqLite: due to d71dbb1a,
the jQuery
detach()
method does not trigger the$destroy
event. If you want to destroy Angular data attached to the element, useremove()
.
1.3.0-beta.8 accidental-haiku (2014-05-09)
Bug Fixes
- $compile: set $isolateScope correctly for sync template directives (562c4e42, #6942)
- $httpBackend: Add missing expectHEAD() method (e1d61784, #7320)
- $interpolate: don't ReferenceError when context is undefined (924ee6db, #7230, #7237)
- grunt-utils: ensure special inline CSS works when
angular
is not a global (af72f40a, #7176) - injector: invoke config blocks for module after all providers (c0b4e2db, #7139, #7147)
- ngModelOptions:
- ngSanitize: encode surrogate pair properly (627b0354, #5088, #6911)
- ngSrc, ngSrcset: only interpolate if all expressions are defined (8d180383, #6984)
- ngSwitch: properly support case labels with different numbers of transclude fns (ac37915e, #7372, #7373)
Features
- $compile: allow SVG and MathML templates via special
type
property (f0e12ea7, #7265) - $interpolate: add optional allOrNothing param (c2362e3f)
- FormController: commit
$viewValue
of all child controls when form is submitted (a0ae07bd, #7017) - NgMessages: introduce the NgMessages module and directives (0f4016c8)
Breaking Changes
- $http: due to ad4336f9,
Previously, it was possible to register a response interceptor like so:
// register the interceptor as a service
$provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
return function(promise) {
return promise.then(function(response) {
// do something on success
return response;
}, function(response) {
// do something on error
if (canRecover(response)) {
return responseOrNewPromise
}
return $q.reject(response);
});
}
});
$httpProvider.responseInterceptors.push('myHttpInterceptor');
Now, one must use the newer API introduced in v1.1.4 (4ae46814), like so:
$provide.factory('myHttpInterceptor', function($q) {
return {
response: function(response) {
// do something on success
return response;
},
responseError: function(response) {
// do something on error
if (canRecover(response)) {
return responseOrNewPromise
}
return $q.reject(response);
}
};
});
$httpProvider.interceptors.push('myHttpInterceptor');
More details on the new interceptors API (which has been around as of v1.1.4) can be found at https://docs.angularjs.org/api/ng/service/$http#interceptors
- injector: due to c0b4e2db,
Previously, config blocks would be able to control behaviour of provider registration, due to being invoked prior to provider registration. Now, provider registration always occurs prior to configuration for a given module, and therefore config blocks are not able to have any control over a providers registration.
Example:
Previously, the following:
angular.module('foo', [])
.provider('$rootProvider', function() {
this.$get = function() { ... }
})
.config(function($rootProvider) {
$rootProvider.dependentMode = "B";
})
.provider('$dependentProvider', function($rootProvider) {
if ($rootProvider.dependentMode === "A") {
this.$get = function() {
// Special mode!
}
} else {
this.$get = function() {
// something else
}
}
});
would have "worked", meaning behaviour of the config block between the registration of "$rootProvider" and "$dependentProvider" would have actually accomplished something and changed the behaviour of the app. This is no longer possible within a single module.
- ngModelOptions: due to adfc322b,
This commit changes the API on NgModelController
, both semantically and
in terms of adding and renaming methods.
$setViewValue(value)
- This method still changes the$viewValue
but does not immediately commit this change through to the$modelValue
as it did previously. Now the value is committed only when a trigger specified in an associatedngModelOptions
directive occurs. IfngModelOptions
also has adebounce
delay specified for the trigger then the change will also be debounced before being committed. In most cases this should not have a significant impact on howNgModelController
is used: IfupdateOn
includesdefault
then$setViewValue
will trigger a (potentially debounced) commit immediately.$cancelUpdate()
- is renamed to$rollbackViewValue()
and has the same meaning, which is to revert the current$viewValue
back to the$lastCommittedViewValue
, to cancel any pending debounced updates and to re-render the input.
To migrate code that used $cancelUpdate()
follow the example below:
Before:
$scope.resetWithCancel = function (e) {
if (e.keyCode == 27) {
$scope.myForm.myInput1.$cancelUpdate();
$scope.myValue = '';
}
};
After:
$scope.resetWithCancel = function (e) {
if (e.keyCode == 27) {
$scope.myForm.myInput1.$rollbackViewValue();
$scope.myValue = '';
}
}
v1.3.0-beta.7 proper-attribution (2014-04-25)
Bug Fixes
Performance Improvements
- scope: ~10x speedup from sharing the child scope class. (8377e818)
v1.3.0-beta.6 expedient-caffeination (2014-04-21)
Bug Fixes
- $animate: ensure class-based animations always perform a domOperation if skipped (708f2ba9, #6957)
- $compile:
- $location:
- input: don't dirty model when input event triggered due to placeholder change (ff428e72, #2614, #5960)
- limitTo: do not convert Infinity to NaN (5dee9e4a, #6771, #7118)
- ngModelController: introduce $cancelUpdate to cancel pending updates (940fcb40, #6994, #7014)
Features
- $resource: Make stripping of trailing slashes configurable. (3878be52)
- Scope: add
$watchGroup
method for observing a set of expressions (21f93163) - injector: "strict-DI" mode which disables "automatic" function annotation (4b1695ec, #6719, #6717, #4504, #6069, #3611)
- ngModelOptions: custom triggers and debounce of ngModel updates (dbe381f2, #1285)
Performance Improvements
- $compile: watch interpolated expressions individually (0ebfa0d1)
- $interpolate: speed up interpolation by recreating watchGroup approach (546cb429)
Breaking Changes
-
$interpolate: due to 88c2193c, the function returned by
$interpolate
no longer has a.parts
array set on it.Instead it has two arrays:
.expressions
, an array of the expressions in the interpolated text. The expressions are parsed with$parse
, with an extra layer converting them to strings when computed.separators
, an array of strings representing the separations between interpolations in the text. This array is always 1 item longer than the.expressions
array for easy merging with it
1.3.0-beta.5 chimeric-glitterfication (2014-04-03)
Bug Fixes
- $animate:
- $parse: mark constant unary minus expressions as constant (7914d346, #6932)
- Scope:
- ngClass: handle ngClassOdd/Even affecting the same classes (c9677920, #5271)
Breaking Changes
- $animate: due to 1cb8584e,
$animate
will no longer default the after parameter to the last element of the parent container. Instead, when after is not specified, the new element will be inserted as the first child of the parent container.
To update existing code, change all instances of $animate.enter()
or $animate.move()
from:
$animate.enter(element, parent);
to:
$animate.enter(element, parent, angular.element(parent[0].lastChild));
1.2.16 badger-enumeration (2014-04-03)
Bug Fixes
- $animate:
- $parse: mark constant unary minus expressions as constant (6e420ff2, #6932)
- Scope:
- filter.ngdoc: Check if "input" variable is defined (a275d539, #6819)
- input: don't perform HTML5 validation on updated model-value (b2363e31, #6796, #6806)
- ngClass: handle ngClassOdd/Even affecting the same classes (55fe6d63, #5271)
Features
1.3.0-beta.4 inconspicuous-deception (2014-03-28)
Bug Fixes
- $animate:
- Scope: aggressively clean up scope on $destroy to minimize leaks (f552f251, #6794, #6856)
- doc-gen: Run Gulp on Windows too (47ba6014, #6346)
- filter.ngdoc: Check if "input" variable is defined (4a6d4de5, #6819)
- input: don't perform HTML5 validation on updated model-value (b472d027, #6796, #6806)
Features
Breaking Changes
-
$animate: due to 1bebe36a,
Any class-based animation code that makes use of transitions and uses the setup CSS classes (such as class-add and class-remove) must now provide a empty transition value to ensure that its styling is applied right away. In other words if your animation code is expecting any styling to be applied that is defined in the setup class then it will not be applied "instantly" unless a
transition:0s none
value is present in the styling for that CSS class. This situation is only the case if a transition is already present on the base CSS class once the animation kicks off.
Before:
.animated.my-class-add {
opacity:0;
transition:0.5s linear all;
}
.animated.my-class-add.my-class-add-active {
opacity:1;
}
After:
.animated.my-class-add {
transition:0s linear all;
opacity:0;
}
.animated.my-class-add.my-class-add-active {
transition:0.5s linear all;
opacity:1;
}
Please view the documentation for ngAnimate for more info.
1.3.0-beta.3 emotional-waffles (2014-03-21)
Bug Fixes
- ngAnimate: support
webkitCancelRequestAnimationFrame
in addition towebkitCancelAnimationFrame
(c839f78b, #6526) - $http: allow sending Blob data using
$http
(b8cc71d4, #5012) - $httpBackend: don't error when JSONP callback is called with no parameter (6680b7b9, #4987, #6735)
- $rootScope: ng-repeat can't handle
NaN
values. #4605 (fb6062fb, #4605) - $rootScope:
$watchCollection
should call listener with old value (78057a94, #2621, #5661, #5688, #6736) - angular.bootstrap: allow angular to load only once (748a6c8d, #5863, #5587)
- jqLite:
inheritedData()
now traverses Shadow DOM boundaries via thehost
property ofDocumentFragment
(8a96f317, #6637) - ngCookie: convert non-string values to string (36528310, #6151, #6220)
- ngTouch: update workaround for Webkit quirk (bc42950b, #6302)
- orderBy: support string predicates containing non-ident characters (37bc5ef4, #6143, #6144)
- select: avoid checking option element's
selected
property in render (f40f54c6, #2448, #5994)
Features
- $compile: add support for
$observer
deregistration (299b220f, #5609) - ngMock.$httpBackend: added support for function as URL matcher (d6cfcace, #4580)
Breaking Changes
- $compile: due to 299b220f,
calling
attr.$observe
no longer returns the observer function, but a deregistration function instead. To migrate the code follow the example below:
Before:
directive('directiveName', function() {
return {
link: function(scope, elm, attr) {
var observer = attr.$observe('someAttr', function(value) {
console.log(value);
});
}
};
});
After:
directive('directiveName', function() {
return {
link: function(scope, elm, attr) {
var observer = function(value) {
console.log(value);
};
attr.$observe('someAttr', observer);
}
};
});
- $httpBackend: due to 6680b7b9, the JSONP behavior for erroneous and empty responses changed: Previously, a JSONP response was regarded as erroneous if it was empty. Now Angular is listening to the correct events to detect errors, i.e. even empty responses can be successful.
v1.2.15 beer-underestimating (2014-03-21)
Bug Fixes
- $$RAFProvider: check for webkitCancelRequestAnimationFrame (e84da228, #6526)
- $$rAF: always fallback to a $timeout incase native rAF isn't supported (ee8e4a94, #6654)
- $compile: support templates with thead and tfoot root elements (ca0ac649, #6289)
- $http:
- $rootScope:
- angular.bootstrap: only allow angular to load once (0d60f8d3, #5863, #5587)
- jqLite: traverse
host
property for DocumentFragment in inheritedData() (98d825e1, #6637) - ngAnimate: setting classNameFilter disables animation inside ng-if (a41a2a1d, #6539)
- ngCookie: convert non-string values to string (93d1c95c, #6151, #6220)
- ngTouch: update workaround for desktop Webkit quirk (01a34f51, #6302)
- orderBy: support string predicates containing non-ident characters (10d3e1e4, #6143, #6144)
- select: avoid checking option element selected properties in render (dc149de9, #2448, #5994, #6769)
1.3.0-beta.2 silent-ventriloquism (2014-03-14)
Bug Fixes
- $$rAF: always fallback to a $timeout in case native rAF isn't supported (7b5e0199, #6654)
- $http: don't convert 0 status codes to 404 for non-file protocols (56e73ea3, #6074, #6155)
- ngAnimate: setting classNameFilter disables animation inside ng-if (129e2e02, #6539)
Features
1.3.0-beta.1 retractable-eyebrow (2014-03-07)
Bug Fixes
- $compile: support templates with thead and tfoot root elements (53ec5e13, #6289)
- style: expressions in style tags (0609453e, #2387, #6492)
Features
Breaking Changes
- build: due to eaa1d00b, As communicated before, IE8 is no longer supported.
- input: types date, time, datetime-local, month, week now always
require a
Date
object as model (46bd6dc8, #5864)
For more info: http://blog.angularjs.org/2013/12/angularjs-13-new-release-approaches.html
1.2.14 feisty-cryokinesis (2014-03-01)
Bug Fixes
- $animate:
- delegate down to addClass/removeClass if setClass is not found (18c41af0, #6463)
- ensure all comment nodes are removed during a leave animation (f4f1f43d, #6403)
- only block keyframes if a stagger is set to occur (e71e7b6c, #4225)
- ensure that animateable directives cancel expired leave animations (e9881991, #5886)
- ensure all animated elements are taken care of during the closing timeout (99720fb5, #6395)
- fix for TypeError Cannot call method 'querySelectorAll' in cancelChildAnimations (c914cd99, #6205)
- $http:
- $parse: reduce false-positives in isElement tests (5fe1f39f, #4805, #5675)
- input: use ValidityState to determine validity (c2d447e3, #4293, #2144, #4857, #5120, #4945, #5500, #5944)
- isElement: reduce false-positives in isElement tests (75515852)
- jqLite: