I've read an article or a SO answer or similar recently, Angular binds to
HTML *properties*, not *attributes*. That's because a html attribute (e.g.
*<div
class="my-class"></div>* or *el.setAttribute('class', 'my-class');* )can
only ever be a string. And a property of a HTML element (*el.className*)
can be an object directly. So to avoid serializing/deserializing a lot,
Angular binds to properties.
That said, you can either use something like *[ngClass]* or
*[class.badCurly]="angularExpression"* to set a class. And if you want to
*reset* the attribute, as you say, you could try *[attr.class]="new-classes
instead of-the-original-ones"*. Didn't test this though, so you should, if
you're going to use it ;)
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.