Class Button

A class that represents a button widget.

Hierarchy (view full)

Constructors

  • Create a new button widget and initialize it.

    Parameters

    • Optional text: string = ''

      Button text.

    • Optional callback: Function = null

      The function to call when the button is clicked.

    Returns Button

Properties

listeners: {
    [key: string]: Function[];
}

Type declaration

  • [key: string]: Function[]
ref: HTMLElement
value: any
view: View

Methods

  • Parameters

    • event: string
    • callback: Function

    Returns void

  • Add a click event listener to the widget.

    Parameters

    • f: Function

      The function to call when the widget is clicked.

    Returns this

  • Set the content of the widget.

    Parameters

    • value: string

      The value to set the content to.

    Returns this

  • Set the text of the widget.

    Parameters

    • value: string

      The value to set the text to.

    Returns this