You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, observer, readOnly, notify, etc are all not available in a Lit Element. It may be helpful to remember that a Polymer element is not a Lit element and, while they both do support the concept of properties, they are very different classes.
That makes sense, I'd just add that it's not super clear from the README and it's easy to make assumptions since this element is part of the Polymer project. Would it make sense to add some sort of feature comparison to PolymerElement in the README?
Reacted by Benjamin Rancourt, Tyler Crocker, Murray Lisook, Max, Paulo Aquino, Val Packett, Zev Isert and antonioaltamura
how to solve somehow we want to get values from an element prototype?
when we get value from "litelemnt.prototype.accessKey" the browser gets an error and stops running the code.
Activity
jsilvermist commentedon Jun 24, 2018
Default values are set in the constructor, not in the properties object.
jimsimon commentedon Jun 24, 2018
Is this specific to lit-element? The polymer docs suggest otherwise: https://www.polymer-project.org/3.0/docs/devguide/properties
jsilvermist commentedon Jun 24, 2018
Yes, using Polymer you can set the default value in properties or the constructor, for lit-element it uses the constructor only.
jimsimon commentedon Jun 24, 2018
Ah okay. Are there any other property restrictions? I feel like I may have missed some documentation somewhere.
markcellus commentedon Jun 24, 2018
Yeah,
observer,readOnly,notify, etc are all not available in a Lit Element. It may be helpful to remember that a Polymer element is not a Lit element and, while they both do support the concept ofproperties, they are very different classes.jimsimon commentedon Jun 24, 2018
That makes sense, I'd just add that it's not super clear from the README and it's easy to make assumptions since this element is part of the Polymer project. Would it make sense to add some sort of feature comparison to
PolymerElementin the README?valpackett commentedon Jul 2, 2018
Looks like another difference is that attributes are not converted to camelCase when mapped to properties...
hzmsrv commentedon Jul 25, 2020
how to solve somehow we want to get values from an element prototype?
when we get value from "litelemnt.prototype.accessKey" the browser gets an error and stops running the code.