mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-10 17:15:26 +08:00
fix(ngClass): handle index changes when an item is unshifted
Closes #7256
This commit is contained in:
@@ -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) :
|
||||
|
||||
Reference in New Issue
Block a user