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

fix(ng:class): make ng:class friendly towards other code adding/removing #541

Merged
merged 5 commits into from
Sep 1, 2011

Conversation

IgorMinar
Copy link
Contributor

No description provided.

@IgorMinar
Copy link
Contributor Author

…ing classes

ng:class as well as ng:class-odd and ng:class-even always reset the
class list to whatever it was before compilation, this makes it
impossible to create another directive which adds its own classes on the
element on which ng:class was applied.

the fix simply removes all classes that were added previously by
ng:class and add classes that the ng:class expression evaluates to.

we can now guarantee that we won't clobber stuff added before or after
compilation as long as all class names are unique.

in order to implement this I had to beef up jqLite#addClass and
jqLite#removeClass to be able to add/remove multiple classes without
creating duplicates.
@IgorMinar IgorMinar merged commit 8d11db0 into angular:master Sep 1, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant