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

Angular v1.5, Directive with class="{{className}}", addClass('extraClass') in link function doesn't work #14354

Closed
aarongan opened this issue Mar 31, 2016 · 2 comments

Comments

@aarongan
Copy link

Hi,
I tried to inject extra className in link function using addClass method, i found a problem is when my directive has expression in class, the injection just ignore and no error message.
eg
directive with class="class-{{ id }}"

and in directive link function, i tried manually addClass('extraClassNam'), this extraClassName doesn't get injected into Dom element after link.

I noticed that, in link function phase, expression didn't get eval compare to previous version.

thanks,
Aaron

@aarongan
Copy link
Author

Continue my investigating...
This is happening in all attributes which i would believe is mechanism change.

Tried any attributes with expression in your template, and add attr('my-attribute', 'xxxx'), it wouldn't work unless i remove expression {{}} in the templates. =(

@Narretz
Copy link
Contributor

Narretz commented Mar 31, 2016

It's a known issue: #12813
There are currently no plans to fix this, as it is a complex problem. But PRs are welcome.

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

No branches or pull requests

2 participants