angular-message-format
Advanced tools
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.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.4.5 permanent-internship (2015-08-28)
$animate.enabled(false)
should disable animations on $animateCss as well
(c3d5e33e,
#12696, #12685)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.3.18"></a>
Changelog
1.4.4 pylon-requirement (2015-08-13)
skipBlocking
avoids the pre-emptive transition-delay styling
(11695ca6)=
signs in values in parseKeyValue
(f13852c1,
#12351)$animateCss
(39b634e5,
#12509)The previous behavior involved ngAnimate having to wait for one
requestAnimationFrame before CSS classes were added/removed. The CSS classes
are now applied directly after the first digest that is triggered after
$animate.addClass
, $animate.removeClass
or $animate.setClass
is
called. If any of your code relies on waiting for one frame before
checking for CSS classes on the element then please change this
behavior. If a parent class-based animation, however, is run through a
JavaScript animation which triggers an animation for beforeAddClass
and/or beforeRemoveClass
then the CSS classes will not be applied
in time for the children (and the parent class-based animation will not
be cancelled by any child animations).
$timeout.flush()
to resolve a call to $q.when
with a value.The previous behavior involved creating an extra promise that needed to be resolved. This is no longer needed when
$q.when
is called with a value. In the case that the test is not aware if $q.when
is called with a value or
another promise, it is possible to replace $timeout.flush();
with $timeout.flush(0);
.
describe('$q.when', function() {
it('should not need a call to $timeout.flush() to resolve already resolved promises',
inject(function($q, $timeout) {
$q.when('foo');
// In AngularJS 1.4.3 a call to `$timeout.flush();` was needed
$timeout.verifyNoPendingTasks();
}));
it('should accept $timeout.flush(0) when not sure if $q.when was called with a value or a promise',
inject(function($q, $timeout) {
$q.when('foo');
$timeout.flush(0);
$timeout.verifyNoPendingTasks();
}));
it('should need a call to $timeout.flush() to resolve $q.when when called with a promise',
inject(function($q, $timeout) {
$q.when($q.when('foo'));
$timeout.flush();
$timeout.verifyNoPendingTasks();
}));
});
form: Due to 94533e57,
the name
attribute of form
elements can now only contain characters that can be evaluated as part
of an Angular expression. This is because Angular uses the value of name
as an assignable expression
to set the form on the $scope
. For example, name="myForm"
assigns the form to $scope.myForm
and
name="myObj.myForm"
assigns it to $scope.myObj.myForm
.
Previously, it was possible to also use names such name="my:name"
, because Angular used a special setter
function for the form name. Now the general, more robust $parse
setter is used.
The easiest way to migrate your code is therefore to remove all special characters from the name
attribute.
If you need to keep the special characters, you can use the following directive, which will replace
the name
with a value that can be evaluated as an expression in the compile function, and then
re-set the original name in the postLink function. This ensures that (1), the form is published on
the scope, and (2), the form has the original name, which might be important if you are doing server-side
form submission.
angular.module('myApp').directive('form', function() {
return {
restrict: 'E',
priority: 1000,
compile: function(element, attrs) {
var unsupportedCharacter = ':'; // change accordingly
var originalName = attrs.name;
if (attrs.name && attrs.name.indexOf(unsupportedCharacter) > 0) {
attrs.$set('name', 'this["' + originalName + '"]');
}
return postLinkFunction(scope, element) {
// Don't trigger $observers
element.setAttribute('name', originalName);
}
}
};
});
<a name="1.4.3"></a>
Changelog
1.4.3 foam-acceleration (2015-07-15)
<a name="1.4.2"></a>
Changelog
1.4.2 nebular-readjustment (2015-07-06)
src
attribute of ngInclude no longer accepts an
expression that returns the result of $sce.trustAsResourceUrl
. This will now cause an infinite digest:Before:
<div ng-include="findTemplate('https://example.com/myTemplate.html')"></div>
$scope.findTemplate = function(templateName) {
return $sce.trustAsResourceUrl(templateName);
};
To migrate, either cache the result of trustAsResourceUrl()
, or put the template url in the resource
whitelist in the config()
function:
After:
var templateCache = {};
$scope.findTemplate = function(templateName) {
if (!templateCache[templateName]) {
templateCache[templateName] = $sce.trustAsResourceUrl(templateName);
}
return templateCache[templateName];
};
// Alternatively, use `$sceDelegateProvider.resourceUrlWhitelist()`:
angular.module('myApp', []).config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist(['self', 'https://example.com/**'])
});
<a name="1.3.17"></a>
Changelog
1.4.1 hyperionic-illumination (2015-06-16)
$locationChangeSuccess
(91b60226,
#11439, #11675, #11935, #12083)undefined
(71fc3f4f,
#12099)
(d19504a1,
#11959)tabindex
attribute
(799353c7,
#8371, #5853)numberInputType
directive
(ebd0fbba,
#12121, #12122)multidir
error
(351fe4b7,
#11775)<a name="1.3.16"></a>
Changelog
1.4.0 jaracimrman-existence (2015-05-26)
<a name="1.4.0-rc.2"></a>