A view for showing subaio-content. Wraps a webview and handles communication with the embedded app, as well as interaction with the shared Manager.

No Views should be created before manager.configure has been invoked.

Hierarchy

  • BridgeView

Constructors

  • Create a wrapped iframe inside a target element. The iframe will have width and height set to 100% and flex to 1 1 auto to fill the container.

    It is important to call view.cleanup() before removing the element from the DOM.

    Parameters

    Returns BridgeView

Properties

element: HTMLElement

The element container

eventHandlers: EventHandlers

Update the event-handlers set by the constructor.

frame: HTMLIFrameElement

The iframe element

status: Status = Status.Initializing

Current status of the view.

Observe with EventHandlers.onStatusChange

title: string = ''

Current title of the view.

Observe with EventHandlers.onTitleChange.

Only useful for applications where a navigation bar is shown above the BridgeView.

Accessors

  • get page(): null | Page
  • Returns null | Page

  • set page(page): void
  • Change the current page. Will cause the view to clear current state and load a new view.

    Primarily useful when changing the page of a single view, otherwise the page can be set through the constructor.

    Parameters

    Returns void

Methods

  • Remove iframe from the dom and unbind all event-handling.

    It is important to always call this method before the BridgeView element is remove from the DOM.

    Returns void

  • Force the view to reload data for its internal state. Note that this may cause some state such as forms and wizard-pages to reset.

    Returns void

  • Send a custom event to the embedded app. name and the shape of data should be agreed upon beforehand between the host app and the embedded app.

    Parameters

    • name: string

      A unique name for the action

    • Optional data: any

      An optional payload of data to be sent along

    Returns void

Generated using TypeDoc