Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngClass applies only changed classes, while erasing non-changed classes #7135

Closed
tomaszkrym opened this issue Apr 16, 2014 · 4 comments
Closed

Comments

@tomaszkrym
Copy link

Let's have (http://plnkr.co/edit/vTOSSE ):

data-ng-class="{'clicked my-btn': ui.clicked === true, 'not-clicked my-btn': ui.clicked !== true}"

When the element is rendered at first, it has the classes applied correctly. But after change of the state (condition), the classes from former state are removed (Here 'not-clicked my-btn', but only new classes (here 'clicked') are applied to the element. The 'my-btn' class is lost.

This issue appeared after upgrade from 1.2.15 to 1.2.16.

@shahata
Copy link
Contributor

shahata commented Apr 16, 2014

ngClass no longer supports multiple classes in single key properly due to a minor regression in 55fe6d6 which fixed #5271

I'll submit a quick PR for this.

@hahla
Copy link
Contributor

hahla commented Apr 21, 2014

+1 to fix in next release. I ran into this today.

@Narretz
Copy link
Contributor

Narretz commented Jun 20, 2014

Fixed in 7eaaca8

@Narretz Narretz closed this as completed Jun 20, 2014
@so0k
Copy link

so0k commented Jun 23, 2014

I had same issue in 1.2.16, updated to 1.2.18 & it is fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants