-
Notifications
You must be signed in to change notification settings - Fork 0
Attribute Parser
Esther Brunner edited this page Oct 9, 2024
·
9 revisions
Web Components can have observed attributes, that trigger the attributeChangedCallback
:
static observedAttributes = ['value']
UIElement parses these attributes according to a declarative static Property called attributeMap
:
static attributeMap = {
value: asInteger
}
The UIElement
base class will assign them to signals in the component with the same name as key:
this.get('value') // will return the current value of the `value` signal as an integer `number` or `undefined` if not a number