Closed GHNewbiee closed 3 years ago
See this example in the other issue you posted: https://github.com/Polymer/lit-element/issues/1102#issuecomment-738289694
Going to close this as we've added this capability to the next major version, and we're not going to address the issue in the current version given that you can work around the problem as shown above.
Hi @sorvell -- this issue is still the top search engine result for iterating properties on a lit-element, and I'm on v3 now, but cannot find out how to list the properties if decorators are used. Can you point to how to do it on new lit versions? Thanks!
Ah! it is static get elementProperties() => Map<string, PropertyDefinition>
I've got a class that extends LitElement from Lit 3.1.3, and elementProperties
does not exist on the instance.
Edit: it's a static function, so can't access it on the instance.
You can access static properties from the constructor:
this.constructor.elementProperties;
When
is used, then
does work.
But when
is used, then
TypeError: can't convert undefined to object
. I suspect it refers toproperties
.So, how can I get the names when
@property()
is used?