-
Notifications
You must be signed in to change notification settings - Fork 27.5k
ngClass broken in Angular 1.0.3? #1637
Comments
This is interesting. My suspicion is pointing to d859dce - as this commit is the most recent. Maybe @IgorMinar could weigh in on this? This might also mean that some test cases are missing to catch a regression like this. |
I´m having this issue too. I reverted the code to the old one and then it starts to work again. |
I'm also having this issue. My workaround because I need some 1.0.3 features: http://jsfiddle.net/3tgCA/5/ |
The commit cebd015 adds a call to the Because the initial interpolation event happens before the initial watch event, Here is a simpler version of @jtymes fiddle: With a debugger you can see that I think fixing this will require |
ngClassWatchAction, when called as a $watch function, gets the wrong old value after it has been invoked previously due to observation of the interpolated class attribute. As a result it doesn't remove classes properly. Keeping track of the old value manually seems to fix this. Fixes angular#1637
ngClassWatchAction, when called as a $watch function, gets the wrong old value after it has been invoked previously due to observation of the interpolated class attribute. As a result it doesn't remove classes properly. Keeping track of the old value manually seems to fix this. Closes #1637
I have same issue |
I noticed some odd ngClass behavior when upgrading from Angular 1.0.1 to 1.0.3. Going back to 1.0.2 fixed the problem. The following fiddle illustrates the problem:
http://jsfiddle.net/provegard/uwwgy/14/
Since
a
isfalse
initially, the text should get the "foo" class and be red. The watch kicks in immediately and changesa
totrue
, which should remove the "foo" class from the text and thus change it back to black. This is what happens in Angular 1.0.2, but not in 1.0.3.(In my real app, I have two Twitter Bootstrap tabs that become initially active at the same time due to this bug.)
The text was updated successfully, but these errors were encountered: