-
Notifications
You must be signed in to change notification settings - Fork 27.4k
ng-show is not working when ng-class is having array expression #12674
Comments
In your plunker your controller is not defined, and this is the error message your got in the console |
Sorry for the wrong plnkr. Here is the updated plnkr. http://plnkr.co/edit/qNTsC8sWS7b1u76zvfbO?p=preview When we remove the ng-class expression every thing work as expected. In the function addRemoveClassesPostDigest at line 4876, elements are added to the postDigestElements and then the classes are validated. When the classes to be added or removed are not valid classNames, elements are not removed from the postDigestElements. Because of which function to apply the classes is never registered (line 4903) |
I have tried different things in your plnkr, and I was able to reproduce only combining an empty string and a null or undefined in the array. Using only null or only empty string works. If you can avoid mixing both you will by-pass the problem. |
I can't do that because the values in my case will be dynamic in nature. This used to work with angular 1.4.3. Only with angular 1.4.4 we are facing this problem. |
Looks like it's caused by 0d6fc2d |
The code is adding an element to the postDigestQueue but then never attaching the handler for removing it since it deems that no valid CSS class names were added. This blocks the subsequent
I think we should ensure that the handler always gets added for valid CSS. |
…ements The postDigest handler was not being added if the first element in to modify the CSS classes contained invalid CSS class names. This meant that subsequent valid CSS class changes were not being handled since we were not then adding the handler for those correct cases. Closes angular#12674
…ements The postDigest handler was not being added if the first element in to modify the CSS classes contained invalid CSS class names. This meant that subsequent valid CSS class changes were not being handled since we were not then adding the handler for those correct cases. Closes angular#12674
I think I have a fix at #12725 |
…ements The postDigest handler was not being added if the first element in to modify the CSS classes contained invalid CSS class names. This meant that subsequent valid CSS class changes were not being handled since we were not then adding the handler for those correct cases. Closes angular#12674
@petebacondarwin, With the changes the example in plnkr is working fine. |
:-) yes I changed the fix but forgot to update the plunger. |
…ements The postDigest handler was not being added if the first element in to modify the CSS classes contained invalid CSS class names. This meant that subsequent valid CSS class changes were not being handled since we were not then adding the handler for those correct cases. Closes angular#12674
…ements The postDigest handler was not being added if the first element in to modify the CSS classes contained invalid CSS class names. This meant that subsequent valid CSS class changes were not being handled since we were not then adding the handler for those correct cases. Closes angular#12674
@petebacondarwin, Thanks for the fix. |
ng-show is not working (angularjs version 1.4.4) when ng-class is having array expression
Here is the plnkr to demonstrate the issue.
http://plnkr.co/edit/qNTsC8sWS7b1u76zvfbO?p=preview
The text was updated successfully, but these errors were encountered: