lit.dev icon indicating copy to clipboard operation
lit.dev copied to clipboard

Clarification on Property Binding (.) in Custom Elements

Open Realrubr2 opened this issue 10 months ago • 2 comments

Hi,

I've read through the documentation but haven't been able to find a clear explanation of how to access property values using the . syntax inside a custom element.

Is this behavior explicitly documented anywhere? I only discovered it through ChatGPT, which referenced a YouTube video, but I would really like to read the official documentation on this.

Thank you!

Realrubr2 avatar Feb 25 '25 13:02 Realrubr2

this.propertyName

Custom elements are just classes that extend from HTMLElement. You can read about how Javascript classes work here.

sorvell avatar Feb 25 '25 13:02 sorvell

Hello, we have the following docs here:

https://lit.dev/docs/templates/expressions/#property-expressions

Did you use the site search for this? If so, can you tell me what you searched for so I can update our site search to include those terms?

e111077 avatar Feb 26 '25 22:02 e111077