Options
All
  • Public
  • Public/Protected
  • All
Menu

Component service gives an access to Component property values. It is meant to ne used from Component instances at runtime

Hierarchy

  • ComponentInterface

Index

Methods

  • getComponentId(element: HTMLElement): string
  • Returns the component Id

    This Id is the tagName which could be used to retrieve the ComponentMetadata

    Parameters

    • element: HTMLElement

      Component element

    Returns string

  • Gets all properties of a component

    Note: returns null value if property does not exist in the element

    Parameters

    • element: HTMLElement

      Component element

    Returns PropertyModel[]

  • Gets the value of a component property

    Parameters

    • element: HTMLElement

      Component element of the property to get

    • id: string

      Property id to get

    Returns PropertyValueModel

    Value of the property

  • getPropertyValueAsBoolean(element: HTMLElement, id: string): Promise<boolean>
  • Gets the value of a component property as a boolean

    Parameters

    • element: HTMLElement

      Component element of the property to get

    • id: string

      Property id to get

    Returns Promise<boolean>

  • getPropertyValueAsNumber(element: HTMLElement, id: string): Promise<number>
  • Gets the value of a component property as a number

    Parameters

    • element: HTMLElement

      Component element of the property to get

    • id: string

      Property id to get

    Returns Promise<number>

  • getPropertyValueAsText(element: HTMLElement, id: string): Promise<string>
  • Gets the value of a component property as a string

    Parameters

    • element: HTMLElement

      Component element of the property to get

    • id: string

      Property id to get

    Returns Promise<string>

  • setProperties(element: HTMLElement, properties: PropertyModel[]): void
  • Sets property values to a component. Only the properties declared in component metadata will be set.

    Parameters

    • element: HTMLElement

      Component element

    • properties: PropertyModel[]

      Properties to set

    Returns void