Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c903b76f6c | |||
| f3a565872d | |||
| 582b03b983 |
@@ -1,3 +1,13 @@
|
||||
<a name="1.7.5"></a>
|
||||
# 1.7.5 anti-prettification (2018-10-04)
|
||||
|
||||
## Bug Fixes
|
||||
- **ngClass:** do not break on invalid values
|
||||
([f3a565](https://github.com/angular/angular.js/commit/f3a565872d802c94bb213944791b11b483d52f73),
|
||||
[#16697](https://github.com/angular/angular.js/issues/16697),
|
||||
[#16699](https://github.com/angular/angular.js/issues/16699))
|
||||
|
||||
|
||||
<a name="1.7.4"></a>
|
||||
# 1.7.4 interstellar-exploration (2018-09-07)
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ piece of cake. Best of all? It makes development fun!
|
||||
|
||||
--------------------
|
||||
|
||||
##### AngularJS will be moving to Long Term Support (LTS) mode on July 1st 2018: [Find out more](https://docs.angularjs.org/misc/version-support-status)
|
||||
**On July 1, 2018 AngularJS entered a 3 year Long Term Support period:** [Find out more](https://docs.angularjs.org/misc/version-support-status)
|
||||
|
||||
##### Looking for the new Angular? Go here: https://github.com/angular/angular
|
||||
**Looking for the new Angular? Go here:** https://github.com/angular/angular
|
||||
|
||||
--------------------
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# AngularJS API Docs
|
||||
|
||||
<div class="alert alert-warning">
|
||||
**AngularJS will be moving to Long Term Support (LTS) mode on July 1st 2018.**: [Find out more](misc/version-support-status).
|
||||
**On July 1, 2018 AngularJS entered a 3 year Long Term Support period:** [Find out more](misc/version-support-status).
|
||||
</div>
|
||||
|
||||
## Welcome to the AngularJS API docs page.
|
||||
|
||||
@@ -125,6 +125,8 @@ function classDirective(name, selector) {
|
||||
}
|
||||
|
||||
function toClassString(classValue) {
|
||||
if (!classValue) return classValue;
|
||||
|
||||
var classString = classValue;
|
||||
|
||||
if (isArray(classValue)) {
|
||||
@@ -133,6 +135,8 @@ function classDirective(name, selector) {
|
||||
classString = Object.keys(classValue).
|
||||
filter(function(key) { return classValue[key]; }).
|
||||
join(' ');
|
||||
} else if (!isString(classValue)) {
|
||||
classString = classValue + '';
|
||||
}
|
||||
|
||||
return classString;
|
||||
|
||||
@@ -88,6 +88,12 @@ describe('ngClass', function() {
|
||||
expect(element.hasClass('AnotB')).toBeFalsy();
|
||||
}));
|
||||
|
||||
it('should not break when passed non-string/array/object, truthy values', inject(function($rootScope, $compile) {
|
||||
element = $compile('<div ng-class="42"></div>')($rootScope);
|
||||
$rootScope.$digest();
|
||||
expect(element.hasClass('42')).toBeTruthy();
|
||||
}));
|
||||
|
||||
it('should support adding multiple classes via an array mixed with conditionally via a map', inject(function($rootScope, $compile) {
|
||||
element = $compile('<div class="existing" ng-class="[\'A\', {\'B\': condition}]"></div>')($rootScope);
|
||||
$rootScope.$digest();
|
||||
|
||||
Reference in New Issue
Block a user