turbodombuilder - v0.9.5
    Preparing search index...

    Class TurboController<ElementType, ViewType, ModelType, EmitterType>

    TurboController

    The MVC base controller class. Its main job is to handle (some part of or all of) the logic of the component. It has access to the element, the model to read and write data, the view to update the UI, and the emitter to listen for changes in the model. It can only communicate with other controllers via the emitter (by firing or listening for changes on a certain key).

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    keyName: string

    The key of the controller. Used to retrieve it in the main component. If not set, if the element's class name is MyElement and the controller's class name is MyElementSomethingController, the key would default to "something".

    element: ElementType

    A reference to the component.

    view?: ViewType

    A reference to the MVC view.

    model?: ModelType

    A reference to the MVC model.

    emitter?: EmitterType

    A reference to the MVC emitter.

    Methods

    • initialize

      Returns void

      Initializes the controller. Specifically, it will setup the change callbacks.

    • Protected

      setupChangedCallbacks

      Returns void

      Setup method intended to initialize change listeners and callbacks.