Interface IContainer

Provides a common interface for all components that can contain other components.

Index

Methods

Methods

public addComponent(component: Component)

Adds a Component object to the current container. Implement this method for an object that will contain one or more component objects in order to programmatically add components to that container.

Parameters

  • component: Component
          The Component object to add.
    

public findComponent(id: string): Component

Returns the specified Component instance. Implement this method for an object that will contain one or more component objects to access components within that container.

Parameters

  • id: string
          The ID of the Component object to search for.
    

Returns

Component

The Component instance with the specified ID.

public getComponents(): Component[]

Returns an array of all objects in the current container that inherit from Component. Implement this method for an object that will contain one or more component objects so that the components in that container are available. Types that implement this method should return a copy of the list of components so that modifying the array does not change the contents of the container.

Returns

Component[]

An array of all objects in the current container that inherit from Component.

public removeComponent(component: Component)

Removes a Component object from the current container.

Parameters

  • component: Component
              The Component object to remove.