0

It seems impossible. Whether I use @HostBinding or elementRef.nativeElement.setAttibute(camelCaseAttribute, "true") in both cases the camelCaseAttribute becomes camelcaseattribute in the rendered dom.

All I want to do is set ngDraggable using a directive, why is that not possible? (ngdraggable will not work)

Thanks a lot.

Sumithran
  • 6,217
  • 4
  • 40
  • 54
  • 1
    Possible duplicate of [setAttribute makes the attribute name lowercase](https://stackoverflow.com/questions/48300610/setattribute-makes-the-attribute-name-lowercase) – Heretic Monkey Oct 07 '18 at 16:09

1 Answers1

0

HTML attributes are not case sensitive. So it doesn't matter.

Attribute names for HTML elements may be written with any mix of lowercase and uppercase letters that are a case-insensitive match for the names of the attributes given in the HTML elements section of this document; that is, attribute names are case-insensitive.

source: http://w3c.github.io/html-reference/documents.html

If you are trying to add ngDraggable directive conditionally I think this is not a good approach. Imho you should ask another question how to apply ngDraggable dynamically.

Martin Nuc
  • 5,604
  • 2
  • 42
  • 48