-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ngClass array syntax behavior not according to documentation #8578
Comments
http://plnkr.co/edit/q87uzBJuk6dWaOpodO4b?p=preview seems to work as expected (or please provide a reproduction, in other words) |
@caitp, you're right; your example works as expected. I'll close this issue. The example in the documentation remains confusing to me though; it allows you to change an element in the array. When the element has one class it works. When specifying more than one class for the element only the last class seems to be applied. |
hmm I see, I'll take a look |
Okay, it actually looks like this is a jqLite bug, edit s/jqLite/ngAnimate/ /cc @matsko |
OK I'll assign it to myself then and I'll fix it. |
What happens is, when you type the It's probably more performant to fix this in ngClass, though |
addClass, removeClass and setClass in Animate have a similar bug anyway. It would be good to see everything together. |
I have encountered this bug while working on an application and this plunker reproduces it: http://plnkr.co/edit/FEkuhH |
OK cool. I will have a look on Saturday. Thank you. |
Handles multi-class definition as an element of an array Closes angular#8578
Is this a bug or should the documentation be updated?
Documentation:
However if an array element has multiple, space-delimited, classes only the last one appears to be applied. This behavior can be seen in the example in the documentation for ngClass.
Moreover; the example code for ngClass also suggest that an array element can only have one class - the placeholder text is "Type: bold, strike or red".
The text was updated successfully, but these errors were encountered: