Angular.js v1.5.0 beta.2 发布,更新内容如下:
Bug 修复
$animate: ensure leave animation calls
closecallback (bfad2a4f,#12278, #12096, #13054)$cacheFactory: check key exists before decreasing cache size count (b9bed7d9,#12321, #12329)
$compile:
bind all directive controllers correctly when using
bindToController(bd7b2177,#11343, #11345)evaluate against the correct scope with bindToController on new scope (50557a6c,#13021, #13025)
bind all directive controllers correctly when using
bindToController(1c13a4f4,#11343, #11345)fix scoping of transclusion directives inside replace directive (1a98c0ee,#12975, #12936, #13244)
use createMap() for $$observe listeners when initialized from attr interpolation (76c2491a,#10446)
properly sanitize xlink:href attribute interoplation (f33ce173,#12524)
$http: apply
transformResponseeven whendatais empty (7c0731ed,#12976, #12979)$location: ensure
$locationChangeSuccessfires even if URL ends with#(4412fe23,#12175, #13251)$parse:
evaluate once simple expressions in interpolations (1caf0b6b,#12983, #13002)
fix typo in error message ("assing" -> "assign") (70dac5ae,#12940)
block assigning to fields of a constructor (e1f4f23f,#12860)
do not convert to string computed properties multiple times (20cf7d5e)
$resource: allow XHR request to be cancelled via timeout promise (4fc73466,#12657, #12675, #10890, #9332)
$rootScope: stop IE9 memory leak when destroying scopes (8fe781fb,#10706, #11786)
$sanitize:
strip urls starting with 'unsafe:' as opposed to 'unsafe' (a4dfa4d0,#12524)
support void elements, fixups, remove dead code, typos (94207f8f,#12524)
Angular.js: fix
isArrayLikefor unusual cases (2c8d87e0,#10186, #8000, #4855, #4751, #10272)filters: ensure
formatNumberobserves i18n decimal separators (658a865c,#10342, #12850)injector: support arrow functions with no parenthesis (03726f7f,#12890)
input: remove workaround for Firefox bug (b366f035)
isArrayLike: handle jQuery objects of length 0 (773efd08)
jqLite:
deregister special
mouseenter/mouseleaveevents correctly (f5aa2079,#12795, #12799)ensure mouseenter works with svg elements on IE (941c1c35,#10259, #10276)
limitTo: start at 0 if
beginis negative and exceeds input length (ecf93048,#12775, #12781)merge:
ensure that jqlite->jqlite and DOM->DOM (75292a6c)
clone elements instead of treating them like simple objects (17715fa3,#12286)
ngAnimate:
ensure anchoring uses body as a container when needed (240d5896,#12872)
callback detection should only use RAF when necessary (8b27c3f0)
ngAria: don't add tabindex to radio and checkbox inputs (662fb282,#12492, #13095)
ngInput: change URL_REGEXP to better match RFC3987 (ffb6b2fb,#11341, #11381)
ngMessage: make ngMessage compatible with ngBind (4971ef12,#8089, #13074)
ngMessages: prevent race condition with ngAnimate (8366622b,#12856, #12903)
ngOptions:
skip comments and empty options when looking for options (395f3ec6,#12190, #13029, #13033)
override select option registration (2fcfd75a,#11685, #12972, #12968, #13012)
skip comments when looking for option elements (7f3f3dd3,#12190)
allow falsy values as option group identifiers (b71d7c3f,#7015, #7024, #12888)
ngResource: encode
&in URL query param values (1c97a605,#12201)orderByFilter: throw error if input is not array-like (2a85a634,#11255, #11719)
特性
$animateCss: add support for temporary styles via
cleanupStyles(9f67da62,#12930)$compile: multiple transclusion via named slots (a4ada8ba,#4357, #12742, #11736, #12934)
$http: add
$xhrFactoryservice to enable creation of custom xhr objects (106f90aa,#2318, #9319, #12159)$injector:
Allow specifying a decorator on $injector (29a05984)
add strictDi property to $injector instance (79577c5d,#11728, #11734)
$templateRequest: support configuration of $http options (b2fc39d2,#13188, #11868, #6860)
Module: add helper method,
component(...)for creating component directives (54e81655,#10007, #12933)linky: add support for custom attributes (06f002b1,#12558, #13061)
ngAnimate: introduce ngAnimateSwap directive (78297d25)
ngMock:
add expectRoute and whenRoute shortcuts with colon param matching (d67e999d,#12406)
invoke nested calls to
module()immediately (51a27c0f,#12887)ngModel: provide ng-empty and ng-not-empty CSS classes (630280c7,#10050, #12848)
性能提升
$compile:
use static jquery data method to avoid creating new instances (9b90c32f)
Lazily compile the
transcludefunction (652b83eb)$interpolate: provide a simplified result for constant expressions (cf83b4f4)
copy:
avoid regex in isTypedArray (c8768d12)
only validate/clear user specified destination (33c67ce7,#12068)
merge: remove unnecessary wrapping of jqLite element (4daafd3d,#13236)
Breaking Changes
$sanitize: due to 181fc567, The svg support in is now an opt-in option
Applications that depend on this option can use to turn the option back on, but while doing so, please read the warning provided in the documentation for information on preventing click-hijacking attacks when this option is turned on.
ngMessage: due to 4971ef12,
ngMessage is now compiled with a priority of 1, which means directives on the same element as ngMessage with a priority lower than 1 will be applied when ngMessage calls the $transclude function. Previously, they were applied during the initial compile phase and were passed the comment element created by the transclusion of ngMessage. To restore this behavior, custom directives need to have their priority increased to at least "1".
ngOptions: due to ded25187,
ngOptions will now throw if ngModel is not present on the selectelement. Previously, having no ngModel let ngOptions silently fail, which could lead to hard to debug errors. The change should therefore not affect any applications, as it simply makes the requirement more strict and alerts the developer explicitly.
orderByFilter: due to 2a85a634,
Previously, an non array-like input would pass through the orderBy filter unchanged. Now, an error is thrown. This can be worked around by converting an object to an array, either manually or using a filter such ashttps://github.com/petebacondarwin/angular-toArrayFilter. (null and undefined still pass through without an error, in order to support asynchronous loading of resources.)
Closes #11255 Closes #11719
详情请看:CHANGELOG.md
下载地址:v1.5.0-beta.2
引用来自“cokolin”的评论
@红薯 ,能不能再ng的介绍页面说说 1.2更新了什么,1.3更新了什么,1.4更新了什么吗?引用来自“Rwing”的评论
2.0到底啥时候?