Skip to main content

@microsoft/fast-element > AttributeDefinition

AttributeDefinition class

An implementation of Accessor that supports reactivity, change callbacks, attribute reflection, and type conversion for custom elements.

Signature:
export declare class AttributeDefinition implements Accessor 

Constructors

ConstructorModifiersDescription
(constructor)(Owner, name, attribute, mode, converter)Creates an instance of AttributeDefinition.

Properties

PropertyModifiersTypeDescription
attributestringThe name of the attribute in HTML.
converterValueConverterA ValueConverter that integrates with the property getter/setter to convert values to and from a DOM string.
modeAttributeModeThe AttributeMode that describes the behavior of this attribute.
namestringThe name of the property associated with the attribute.
OwnerFunctionThe class constructor that owns this attribute.

Methods

MethodModifiersDescription
getValue(source)Gets the value of the attribute/property on the source element.
setValue(source, newValue)Sets the value of the attribute/property on the source element.