angular-cookies
Advanced tools
Changelog
1.5.0-rc.1 quantum-fermentation (2016-01-15)
$animate.closeAndFlush()
(e1def1b8,
#13005, #13576, #13707)$
(4e1b36c2,
#13736)$component: These breaking changes affect only applications updating from previous 1.5 beta / rc versions
Due to d91cf167,
the default controllerAs
value for components is now $ctrl
(previously the name of the component was used).
To migrate, either set controllerAs
to the component name, or change the property name in your templates
to $ctrl
Due to 25bc5318, it is no longer possible to
set the restrict
option on directives created via the module.component()
helper.
All components are now element directives (restrict: 'E'
). If you need a directive that is not an element then you must use the
module.directive()
helper instead.
Due to f31c5a39,
components are now always created with scope: {}
(isolate scope). Previously, it was also possible to create components
with scope: true
or scope: false
. If your components rely on this scope configuration, you will have to
create a regular directive instead.
Due to 6a47c0d7,
the transclude
property is now false
by default (previously true
). If you created components that expected
transclusion then you must change your code to specify transclude: true
.
linky: due to 98c2db7f,
Before this change, the filter assumed that the input (if not undefined/null) was of type 'string'
and that certain methods (such as .match()
) would be available on it. Passing a non-string value
would most likely result in a not-very-useful error being thrown (trying to call a method that does
not exist) or in unexpected behavior (if the input happened to have the assumed methods).
After this change, a proper (informative) error will be thrown. If you want to pass non-string
values through linky
, you need to explicitly convert them to strings first.
Since input values could be initialized asynchronously, undefined
or null
will still be
returned unchanged (without throwing an error).
<a name="1.5.0-rc.0"></a>
Changelog
1.5.0-rc.0 oblong-panoptikum (2015-12-09)
This is the first Release Candidate for AngularJS 1.5.0. Please try upgrading your applications and report any regressions or other issues you find as soon as possible.
$locals
(0ea53503)$cancelRequest()
(98528be3,
#9332, #13050, #13058, #13210)resolveAs: '$resolve'
(983b0598,
#13400)<use>
elements
(7a668cdd,
#13453)$providerInjector
after each test
(a72c12bd,
#13397, #13416)This is only a breaking change to a feature that was added in beta 2. If you have not started using multi-slot transclusion then this will not affect you.
The keys and values for the transclude
map of the directive definition have been swapped around
to be more consistent with the other maps, such as scope
and bindToController
.
Now the key
is the slot name and the value
is a normalized element selector.
Using a promise as timeout
is no longer supported and will log a
warning. It never worked the way it was supposed to anyway.
Before:
var deferred = $q.defer();
var User = $resource('/api/user/:id', {id: '@id'}, {
get: {method: 'GET', timeout: deferred.promise}
});
var user = User.get({id: 1}); // sends a request
deferred.resolve(); // aborts the request
// Now, we need to re-define `User` passing a new promise as `timeout`
// or else all subsequent requests from `someAction` will be aborted
User = $resource(...);
user = User.get({id: 2});
After:
var User = $resource('/api/user/:id', {id: '@id'}, {
get: {method: 'GET', cancellable: true}
});
var user = User.get({id: 1}); // sends a request
user.$cancelRequest(); // aborts the request
user = User.get({id: 2});
The $sanitize service will now remove instances of the <use>
tag from the content passed to it.
This element is used to import external SVG resources, which is a security risk as the $sanitize
service does not have access to the resource in order to sanitize it.
A new property to access route resolves is now available on the scope of the route. The default name
for this property is $resolve
. If your scope already contains a property with this name then it
will be hidden or overwritten.
In this case, you should choose a custom name for this property, that does not collide with other
properties on the scope, by specifying the resolveAs
property on the route.
A new property to access all the locals for an expression is now available on the scope. This property
is $locals
.
scope.$locals
already exists, the way to reference this property is now this.$locals
.$locals
then the way to reference that is now $locals.$locals
.<a name="1.4.8"></a>
Changelog
1.4.8 ice-manipulation (2015-11-19)
close
callback
(6bd6dbff,
#12278, #12096, #13054)transformResponse
even when data
is empty
(c6909464,
#12976, #12979)$locationChangeSuccess
fires even if URL ends with #
(6f8ddb6d,
#12175, #13251)isArrayLike
for unusual cases
(70edec94,
#10186, #8000, #4855, #4751, #10272)begin
is negative and exceeds input length
(4fc40bc9,
#12775, #12781)<a name="1.5.0-beta.2"></a>
Changelog
1.5.0-beta.2 effective-delegation (2015-11-17)
close
callback
(bfad2a4f,
#12278, #12096, #13054)bindToController
(bd7b2177,
1c13a4f4
#11343, #11345)transformResponse
even when data
is empty
(7c0731ed,
#12976, #12979)$locationChangeSuccess
fires even if URL ends with #
(4412fe23,
#12175, #13251)isArrayLike
for unusual cases
(2c8d87e0,
#10186, #8000, #4855, #4751, #10272)begin
is negative and exceeds input length
(ecf93048,
#12775, #12781)component(...)
for creating component directives
(54e81655,
#10007, #12933)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".
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 as
https://github.com/petebacondarwin/angular-toArrayFilter.
(null
and undefined
still pass through without an error, in order to
support asynchronous loading of resources.)
<a name="1.5.0-beta.1"></a>
Changelog
1.4.7 dark-luminescence (2015-09-29)
formatNumber
observes i18n decimal separators
(4994acd2,
#10342, #12850)jqLiteBuildFragment
(cdd1227a,
#10617, #12759)cleanupStyles
(e52d731b,
#12930)$xhrFactory
service to enable creation of custom xhr objects
(7a413df5,
#2318, #9319, #12159)<a name="1.3.20"></a>
Changelog
1.2.29 ultimate-deprecation (2015-09-29)
<a name="1.5.0-beta.0"></a>
Changelog
1.4.6 multiplicative-elevation (2015-09-17)
null
when post-data is undefined
(6f39f108,
#12141, #12739)ng-jq
is empty
(19ecdb54,
#12741)<a name="1.3.19"></a>
Changelog
1.3.19 glutinous-shriek (2015-09-15)
$animate.flush
for unit testing
(f98e0384)The ngPattern
and pattern
directives will validate the regex
against the viewValue
of ngModel
, i.e. the value of the model
before the $parsers are applied. Previously, the modelValue
(the result of the $parsers) was validated.
This fixes issues where input[date]
and input[number]
cannot
be validated because the viewValue string is parsed into
Date
and Number
respectively (starting with AngularJS 1.3).
It also brings the directives in line with HTML5 constraint
validation, which validates against the input value.
This change is unlikely to cause applications to fail, because even in AngularJS 1.2, the value that was validated by pattern could have been manipulated by the $parsers, as all validation was done inside this pipeline.
If you rely on the pattern being validated against the modelValue, you must create your own validator directive that overwrites the built-in pattern validator:
.directive('patternModelOverwrite', function patternModelOverwriteDirective() {
return {
restrict: 'A',
require: '?ngModel',
priority: 1,
compile: function() {
var regexp, patternExp;
return {
pre: function(scope, elm, attr, ctrl) {
if (!ctrl) return;
attr.$observe('pattern', function(regex) {
/**
* The built-in directive will call our overwritten validator
* (see below). We just need to update the regex.
* The preLink fn guarantees our observer is called first.
*/
if (isString(regex) && regex.length > 0) {
regex = new RegExp('^' + regex + '$');
}
if (regex && !regex.test) {
//The built-in validator will throw at this point
return;
}
regexp = regex || undefined;
});
},
post: function(scope, elm, attr, ctrl) {
if (!ctrl) return;
regexp, patternExp = attr.ngPattern || attr.pattern;
//The postLink fn guarantees we overwrite the built-in pattern validator
ctrl.$validators.pattern = function(value) {
return ctrl.$isEmpty(value) ||
isUndefined(regexp) ||
regexp.test(value);
};
}
};
}
};
});
<a name="1.4.5"></a>