Holds the logic for tab management in AbstractTabViewComponent. If you want to implement your own TabViewComponent, you might want to extend this class to hold your logic.

Implements

Constructors

Properties

openedTabs: OpenedTab[]

Holds the tabs that are opened in the tab view, and allows them to be bound to HTML.

selectedIndex: FormControl<number>

Holds the index of the currently selected tab.

Selected index initializes to 0.

DYNAMIC_TAB_VIEW_ID_SEGMENT: "dynamic" = 'dynamic'

Methods

  • Closes the tab at the given index.

    If the conditions for closing a tab are not met throws an Error with the given message.

    Parameters

    • index: number

      index of the tab that should be closed

    • force: boolean

      when true closes a tab even if it's cantBeClosed attribute is set to true

    • error: string

      the message that should be displayed if the conditions for closing a tab are not met

    Returns void

  • Initializes the tab if it wasn't initialized yet. Creates a new ComponentPortal for the tab and provides the data for the tab under the NAE_TAB_DATA injection token.

    Parameters

    • index: number

      index of the tab that should be initialized

    Returns void

  • Opens a new tab with the provided content.

    Parameters

    • tabContent: TabContent

      content of the new tab

    • autoswitch: boolean = false

      whether the newly opened tab should be switched to. Defaults to false.

    • openExisting: boolean = true

      whether the opened tab already existing should be switched to existing one. Defaults to true.

    Returns string

    the tabUniqueId of the newly opened tab