Ibyar/Aurora
    Preparing search index...

    Class ViewContainerRefAbstract

    Hierarchy (View Summary)

    Index
    • get anchorElement(): Element

      Anchor element that specifies the location of this container in the containing view. Each view container can have only one anchor element, and each anchor element can have only a single view container.

      Root elements of views attached to this container become siblings of the anchor element in the rendered view.

      Access the ViewContainerRef of an element by placing a Directive injected with ViewContainerRef on the element, or use a ViewChild query.

      Returns Element

    • get length(): number

      Reports how many views are currently attached to this container.

      Returns number

      The number of views.

    • move a view to a new location from another container

      Type Parameters

      • T

      Parameters

      • viewRef: EmbeddedViewRef<T>

        the view that needed to be inserted in this container.

      • OptionalnewIndex: number

        new index in this container, or append

      Returns void

    • Destroys all views in this container.

      Returns void

    • create component by tag name selector.

      Type Parameters

      • C extends {}

      Parameters

      • selector: string

        the tag name for the aurora custom-element

      • Optionaloptions: IndexOptions

      Returns ComponentViewRef<C>

    • create component by the aurora custom-element View Class

      Type Parameters

      • C extends {}

      Parameters

      • viewClass: Type<HTMLComponent<C>>

        the generated aurora view class

      • Optionaloptions: IndexOptions

      Returns ComponentViewRef<C>

    • Instantiates a single component and inserts its host view into this container.

      Type Parameters

      • C extends {}

      Parameters

      • componentType: Type<C>

        Component Type to use.

      • Optionaloptions: ViewContainerComponentOptions

        An object that contains extra parameters:

        • index: the index at which to insert the new component's host view into this container. If not specified, appends the new view as the last entry.
        • selector: the tag name of the new create component that attached with this model class. Any Model class can have many views with different selectors.

      Returns ComponentViewRef<C>

      The new HTMLComponent which contains the component instance and the host view.

    • create an HTMLElement by tag name selector.

      Type Parameters

      • K extends keyof HTMLElementTagNameMap

      Parameters

      Returns ElementRef<HTMLElementTagNameMap[K]>

    • create an HTMLElement by tag name selector.

      Type Parameters

      • K extends keyof HTMLElementDeprecatedTagNameMap

      Parameters

      Returns ElementRef<HTMLElementDeprecatedTagNameMap[K]>

    • create HTMLElement by View Class reference

      Type Parameters

      • C extends HTMLElement

      Parameters

      Returns ElementRef<C>

    • Instantiates an embedded view and inserts it into this container.

      Type Parameters

      • C extends {}

      Parameters

      Returns EmbeddedViewRef<C>

      The ViewRef instance for the newly created view.

    • create a text node and insert to the view

      Parameters

      • data: string
      • Optionaloptions: IndexOptions

      Returns Text

    • Detaches a view from this container without destroying it. Use along with insert() to move a view within the current container.

      Type Parameters

      • T

      Parameters

      • Optionalindex: number

        The 0-based index of the view to detach. If not specified, the last view in the container is detached.

      Returns EmbeddedViewRef<T> | undefined

    • Performs the specified action for each element in an array.

      Type Parameters

      • T

      Parameters

      Returns void

    • Retrieves a view from this container.

      Type Parameters

      • T

      Parameters

      • index: number

        The 0-based index of the view to retrieve.

      Returns EmbeddedViewRef<T> | undefined

      The ViewRef instance, or null if the index is out of range.

    • Returns the index of a view within the current container.

      Parameters

      • viewRef: ViewRef

        The view to query.

      Returns number

      The 0-based index of the view's position in this container, or -1 if this container doesn't contain the view.

    • Inserts a view into this container.

      Parameters

      • viewRef: ViewRef

        The view to insert.

      • Optionalindex: number

        The 0-based index at which to insert the view. If not specified, appends the new view as the last entry.

      Returns ViewRef

      The inserted ViewRef instance.

    • Moves a view to a new location in this container.

      Parameters

      • oldIndex: number

        The 0-based index of the old location.

      • newIndex: number

        The 0-based index of the new location.

      Returns void

    • Destroys a view attached to this container

      Type Parameters

      • T

      Parameters

      • Optionalindex: number

        The 0-based index of the view to destroy. If not specified, the last view in the container is removed.

      Returns EmbeddedViewRef<T> | undefined

    • remove a view attached to this container with out destroying it. the view will be still attached to the DOM. useful in case of moving the view/component to anther container without realizing it again. returns the view.

      Type Parameters

      • T

      Parameters

      • index: number
      • destroy: false

      Returns EmbeddedViewRef<T> | undefined

      the view in the index

    • swap 2 view position

      Parameters

      • index1: number
      • index2: number

      Returns void