angular-cookies
Advanced tools
Changelog
1.2.18 ear-extendability (2014-06-13)
<a name="1.3.0-beta.11"></a>
Changelog
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
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 unaffected from this change.
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.
Both the API for the cancelation 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.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...
The value of $binding
data property on an element is always an array now
and the expressions do not include the curly braces {{ ... }}
.
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
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
NgModel.viewValue will always be used when rendering validations for minlength
and maxlength
.
Closes #7967 Closes #8811
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.
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
.
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
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();
}
};
});
<a name="1.2.23"></a>
Changelog
1.2.16 badger-enumeration (2014-04-03)
<a name="1.3.0-beta.4"></a>
Changelog
v1.2.15 beer-underestimating (2014-03-21)
host
property for DocumentFragment in inheritedData()
(98d825e1,
#6637)<a name="1.3.0-beta.2"></a>
Changelog
1.2.14 feisty-cryokinesis (2014-03-01)
<a name="1.2.13"></a>
Changelog
1.2.13 romantic-transclusion (2014-02-14)
$animate:
due to 4f84f6b3,
ngClass and {{ class }} will now call the setClass
animation callback instead of addClass / removeClass when both a
addClass/removeClass operation is being executed on the element during the animation.
Please include the setClass animation callback as well as addClass and removeClass within your JS animations to work with ngClass and {{ class }} directives.
due to cf5e463a,
Both the $animate:before
and $animate:after
DOM events must be now
registered prior to the $animate operation taking place. The $animate:close
event
can be registered anytime afterwards.
DOM callbacks used to fired for each and every animation operation that occurs within the $animate service provided in the ngAnimate module. This may end up slowing down an application if 100s of elements are being inserted into the page. Therefore after this change callbacks are only fired if registered on the element being animated.
input:
due to a9fcb0d0, input[type=file] will no longer support ngModel. Due to browser support being spotty among target browsers, file inputs cannot be cleanly supported, and even features which technically do work (such as ng-change) work in an inconsistent way depending on the attributes of the form control.
As a workaround, one can manually listen for change events on file inputs and handle them manually.
<a name="1.2.12"></a>
Changelog
1.2.12 cauliflower-eradication (2014-02-07)
locale_lt
(95be253f,
#6164)finally
and catch
(074b0675,
#6048, #6076)inject
with this
set to the current spec
(3bf43903,
#6102)The animation mock module has been renamed from mock.animate
to ngAnimateMock
. In addition to the rename, animations will not block within test code even when ngAnimateMock is used. However, all function calls to $animate will be recorded into $animate.queue
and are available within test code to assert animation calls. In addition, $animate.triggerReflow()
is now only available when ngAnimateMock
is used.
<a name="1.2.11"></a>
Changelog
1.2.11 cryptocurrency-hyperdeflation (2014-02-03)
finally
and catch
(074b0675,
#6048, #6076)<a name="1.2.10"></a>
Changelog
1.2.10 augmented-serendipity (2014-01-24)
<a name="1.2.9"></a>
Changelog
1.2.9 enchanted-articulacy (2014-01-15)
$http: due to e1cfb195, it is now necessary to separately specify default HTTP headers for PUT, POST and PATCH requests, as these no longer share a single object.
To migrate your code, follow the example below:
Before:
// Will apply to POST, PUT and PATCH methods
$httpProvider.defaults.headers.post = {
"X-MY-CSRF-HEADER": "..."
};
After:
// POST, PUT and PATCH default headers must be specified separately,
// as they do not share data.
$httpProvider.defaults.headers.post =
$httpProvider.defaults.headers.put =
$httpProviders.defaults.headers.patch = {
"X-MY-CSRF-HEADER": "..."
};
<a name="1.2.8"></a>