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

ng:class{,-odd,-even} shouldn't reset element classes #355

Closed
groner opened this issue May 25, 2011 · 3 comments
Closed

ng:class{,-odd,-even} shouldn't reset element classes #355

groner opened this issue May 25, 2011 · 3 comments
Assignees
Milestone

Comments

@groner
Copy link
Contributor

groner commented May 25, 2011

ng:class remembers the classes present at compile time and resets the target element's classes whenever $eval() is run. Any other classes that have been added or removed since the element was compiled are reset.

I have prepared an example showing how this breaks the jQueryUI selectable widget.
http://jsfiddle.net/gronky/XsHqL/

@ghost ghost assigned mhevery May 26, 2011
@ghost ghost assigned Codier Jul 6, 2011
@IgorMinar
Copy link
Contributor

Instead of remembering what classes were applied to an element during the compile time, we should do the following:

  • if model value changed do the following, otherwise skip
  • check the DOM and read all classes applied to the element
  • add/remove our class to/from the string
  • push the class string to the DOM

@Codier Codier closed this as completed in 2428907 Jul 13, 2011
@IgorMinar
Copy link
Contributor

This issue wasn't completely fixed. The original test case still doesn't work because of: #473

@IgorMinar
Copy link
Contributor

After a long discussion we reverted this commit and decided to mark this issue as wontfix. Please see the commit message for more details.

3ea2416

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 a pull request may close this issue.

4 participants