Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FieldBuilder

The field builder provides services to define fields. A field is an attribute bound to a property. The value is hosted by the attribute but it can be mutated using the bound property.

Hierarchy

  • FieldBuilder

Implements

Index

Constructors

constructor

  • Parameters

    • propName: string
    • attrName: string
    • Default value isBoolean: boolean = false
    • Default value listeners: Array<FieldListener> = []

    Returns FieldBuilder

Properties

Private attrName

attrName: string

Private isBoolean

isBoolean: boolean

Private listeners

listeners: Array<FieldListener>

Private propName

propName: string

Methods

attribute

  • attribute(attrName: string): this
  • Override the default attribute name.

    Parameters

    • attrName: string

      the attribute name

    Returns this

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

listener

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

    Parameters

    Returns this

Static field

  • Property Decorator used to bind a property to an attribute.

    Parameters

    Returns (Anonymous function)

Static get

Static listen

  • Method Decorator used to register a listener listening to field changes.

    Parameters

    Returns (Anonymous function)

Generated using TypeDoc