From 85dca88bd8325befc65b083276881a7d492e7fce Mon Sep 17 00:00:00 2001 From: trevordowdle Date: Thu, 15 May 2014 12:42:56 -0600 Subject: [PATCH] Update ngClass.js I don't know if this was intended, but I don't think the code was comparing the indexes correctly and it was causing some weird behavior when setting classes on ng-class-even and ng-class-odd. See the following plunkr for an example of the bug. http://plnkr.co/edit/VAi6DB0QdWRutNGnVdSL?p=preview Select the Red Radio button option to see that when switching classes on rows the classes are not always switched properly. --- src/ng/directive/ngClass.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ng/directive/ngClass.js b/src/ng/directive/ngClass.js index b00dbc666406..82aaad893497 100644 --- a/src/ng/directive/ngClass.js +++ b/src/ng/directive/ngClass.js @@ -19,7 +19,7 @@ function classDirective(name, selector) { scope.$watch('$index', function($index, old$index) { // jshint bitwise: false var mod = $index & 1; - if (mod !== old$index & 1) { + if (mod !== (old$index & 1)) { var classes = arrayClasses(scope.$eval(attr[name])); mod === selector ? addClasses(classes) :