Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AttributeBuilder

The attribute builder provides services to initialize an attribute and react on changes.

Hierarchy

  • AttributeBuilder

Implements

Index

Constructors

constructor

Properties

Private attrName

attrName: string

Private defaultValue

defaultValue: boolean | string

Private isBoolean

isBoolean: boolean

Private listeners

listeners: Array<AttributeListener>

Methods

boolean

  • boolean(): this
  • When the value is truthy, the attribute's value is "". When the value is falsy, the attribute is removed.

    Returns this

build

default

  • default(value: string | boolean): this
  • Set a default value when the attribute is unbound.

    Parameters

    • value: string | boolean

      the default value

    Returns this

listener

  • Register a listener which will be invoked when the attribute's value changed.

    Parameters

    Returns this

Static get

Static listen

Generated using TypeDoc