Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Attribute

Manage a attribute attached to components.

Hierarchy

  • Attribute

Index

Properties

component

component: Component

A component reference that this attribute is bound to.

type

{Component}

convertContext

convertContext: any

converter

A function to convert any values into ideal type.

type

{AttributeConverter}

declaration

The declaration of attribute used for defining this attribute.

type

{IAttributeDeclaration}

name

The name of attribute.

type

{NSIdentity}

Accessors

Value

  • get Value(): any
  • set Value(val: any): void
  • Get a value with specified type.

    Returns any

    value with specified type.

  • Set a value with any type.

    Parameters

    • val: any

      Value with string or specified type.

    Returns void

    value with specified type.

companion

tree

Methods

boundTo

  • boundTo(variableName: string, targetObject?: any): void
  • Bind converted value to specified field. When target object was not specified, field of owner component would be assigned.

    Parameters

    • variableName: string
    • Default value targetObject: any = this.component

    Returns void

resolveDefaultValue

  • resolveDefaultValue(domValues: object): void
  • Apply default value to attribute from DOM values.

    Parameters

    • domValues: object
      • [key: string]: string

    Returns void

unwatch

  • unwatch(target: function): void
  • Remove event handler you added.

    Parameters

    • target: function
        • (newValue: any, oldValue: any, attr: Attribute): void
        • Parameters

          • newValue: any
          • oldValue: any
          • attr: Attribute

          Returns void

    Returns void

    [description]

watch

  • watch(watcher: function, immedateCalls?: boolean, ignoireActiveness?: boolean): void
  • Add event handler to observe changing this attribute.

    Parameters

    • watcher: function
        • (newValue: any, oldValue: any, attr: Attribute): void
        • Parameters

          • newValue: any
          • oldValue: any
          • attr: Attribute

          Returns void

    • Default value immedateCalls: boolean = false
    • Default value ignoireActiveness: boolean = false

    Returns void

Static convert

Static generateAttributeForComponent

  • Construct a new attribute with name of key and any value with specified type. If constant flag is true, This attribute will be immutable. If converter is not served, string converter will be set as default.

    Parameters

    Returns Attribute

Generated using TypeDoc